fix(Core/Spells): Base spell resistances from auras should apply to pets. (#10562)

- Closes #10555
This commit is contained in:
UltraNix
2022-02-15 17:49:13 +01:00
committed by GitHub
parent 36d4b89383
commit 77bab657e5

View File

@@ -3988,18 +3988,16 @@ void AuraEffect::HandleModBaseResistance(AuraApplication const* aurApp, uint8 mo
Unit* target = aurApp->GetTarget();
// only players have base stats
if (target->GetTypeId() != TYPEID_PLAYER)
// only players and pets have base stats
if (target->IsPlayer() || target->IsPet())
{
//only pets have base stats
if (target->IsPet() && (GetMiscValue() & SPELL_SCHOOL_MASK_NORMAL))
target->HandleStatModifier(UNIT_MOD_ARMOR, TOTAL_VALUE, float(GetAmount()), apply);
}
else
{
for (int i = SPELL_SCHOOL_NORMAL; i < MAX_SPELL_SCHOOL; i++)
for (uint8 i = SPELL_SCHOOL_NORMAL; i < MAX_SPELL_SCHOOL; i++)
{
if (GetMiscValue() & (1 << i))
{
target->HandleStatModifier(UnitMods(UNIT_MOD_RESISTANCE_START + i), TOTAL_VALUE, float(GetAmount()), apply);
}
}
}
}