mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
Core/Units: Fixed crash in Unit::CalcArmorReducedDamage when called from periodic aura tick if caster is no longer in world
Closes #26776
This commit is contained in:
@@ -1634,11 +1634,15 @@ void Unit::HandleEmoteCommand(uint32 anim_id, Trinity::IteratorPair<int32 const*
|
||||
if (G3D::fuzzyLe(armor, 0.0f))
|
||||
return damage;
|
||||
|
||||
Classes attackerClass = CLASS_WARRIOR;
|
||||
if (attacker)
|
||||
{
|
||||
attackerLevel = attacker->GetLevelForTarget(victim);
|
||||
attackerClass = Classes(attacker->getClass());
|
||||
}
|
||||
|
||||
// Expansion and ContentTuningID necessary? Does Player get a ContentTuningID too ?
|
||||
float armorConstant = sDB2Manager.EvaluateExpectedStat(ExpectedStatType::ArmorConstant, attackerLevel, -2, 0, Classes(attacker->getClass()));
|
||||
float armorConstant = sDB2Manager.EvaluateExpectedStat(ExpectedStatType::ArmorConstant, attackerLevel, -2, 0, attackerClass);
|
||||
|
||||
if (!(armor + armorConstant))
|
||||
return damage;
|
||||
|
||||
Reference in New Issue
Block a user