Core/Units: Fixed crash in Unit::CalcArmorReducedDamage when called from periodic aura tick if caster is no longer in world
Port From (https://github.com/TrinityCore/TrinityCore/commit/9067eb22ced9fdceb36f344b63af0edae1f4142a)
This commit is contained in:
@@ -3797,11 +3797,15 @@ namespace Game.Entities
|
||||
if (MathFunctions.fuzzyLe(armor, 0.0f))
|
||||
return damage;
|
||||
|
||||
Class attackerClass = Class.Warrior;
|
||||
if (attacker != null)
|
||||
{
|
||||
attackerLevel = attacker.GetLevelForTarget(victim);
|
||||
attackerClass = attacker.GetClass();
|
||||
}
|
||||
|
||||
// Expansion and ContentTuningID necessary? Does Player get a ContentTuningID too ?
|
||||
float armorConstant = Global.DB2Mgr.EvaluateExpectedStat(ExpectedStatType.ArmorConstant, attackerLevel, -2, 0, attacker.GetClass());
|
||||
float armorConstant = Global.DB2Mgr.EvaluateExpectedStat(ExpectedStatType.ArmorConstant, attackerLevel, -2, 0, attackerClass);
|
||||
if ((armor + armorConstant) == 0)
|
||||
return damage;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user