message: Apply changes to death attack
diff: @@ -226,6 +226,8 @@ void SneakAttackCritImmunity::CNWSCreature__ResolveDeathAttack_hook(CNWSCreature
  v.y -= pTarget->m_vPosition.y;
  v.z -= pTarget->m_vPosition.z;
  fDistance = v.x * v.x + v.y * v.y + v.z * v.z;
  + if (fDistance >= SNEAK_ATTACK_DISTANCE)
  + return;
  }
  bool isDeathAttack = false;
  @@ -233,9 +235,13 @@ void SneakAttackCritImmunity::CNWSCreature__ResolveDeathAttack_hook(CNWSCreature
  auto* pVisNode = pTarget->GetVisibleListElement(pThis->m_idSelf);
  if (!pVisNode || !pVisNode->m_bSeen || pTarget->GetFlatFooted())
  {
  - isDeathAttack = (!pAttackData->m_bRangedAttack || fDistance < SNEAK_ATTACK_DISTANCE);
  + isDeathAttack = true;
  }
  - else if (pTarget->m_pStats->HasFeat(Constants::Feat::UncannyDodge2))
  + else if (pThis->GetFlanked(pTarget))
  + {
  + isDeathAttack = true;
  +
  + if (pTarget->m_pStats->HasFeat(Constants::Feat::UncannyDodge2))
  {
  const uint8_t uncannyClasses[] =
  {
  @@ -256,12 +262,8 @@ void SneakAttackCritImmunity::CNWSCreature__ResolveDeathAttack_hook(CNWSCreature
  defenderLevels += (defenderClass == uncannyClasses[j]) ? pTarget->m_pStats->GetClassLevel(i, false) : 0;
  }
  }
  - if (attackerLevels - defenderLevels >= Globals::Rules()->GetRulesetIntEntry("FLANK_LEVEL_RANGE", 4))
  - {
  - if (pThis->GetFlanked(pTarget)) // Bad function name, but this does the correct check
  - {
  - isDeathAttack = (!pAttackData->m_bRangedAttack || fDistance < SNEAK_ATTACK_DISTANCE);
  - }
  +
  + isDeathAttack = attackerLevels - defenderLevels >= Globals::Rules()->GetRulesetIntEntry("FLANK_LEVEL_RANGE", 4);
  }
  }
  @@ -276,7 +278,7 @@ void SneakAttackCritImmunity::CNWSCreature__ResolveDeathAttack_hook(CNWSCreature
  }
  else
  {
  - pAttackData->m_bDeathAttack = 1;
  + pAttackData->m_bSneakAttack = 1;
  }
  }
  }
  