fix(Core/Spells): Resistance auras should affect creatures. (#12946)

Fixes #12867
This commit is contained in:
UltraNix
2022-09-03 15:32:30 +02:00
committed by GitHub
parent 674f7e0f12
commit 31892275b0
@@ -3953,19 +3953,10 @@ void AuraEffect::HandleAuraModBaseResistancePCT(AuraApplication const* aurApp, u
return; return;
Unit* target = aurApp->GetTarget(); Unit* target = aurApp->GetTarget();
// only players have base stats
if (target->GetTypeId() != TYPEID_PLAYER)
{
//pets only have base armor
if (target->IsPet() && (GetMiscValue() & SPELL_SCHOOL_MASK_NORMAL))
target->HandleStatModifier(UNIT_MOD_ARMOR, BASE_PCT, float(GetAmount()), apply);
}
else
{
for (int8 x = SPELL_SCHOOL_NORMAL; x < MAX_SPELL_SCHOOL; x++) for (int8 x = SPELL_SCHOOL_NORMAL; x < MAX_SPELL_SCHOOL; x++)
{ {
if (GetMiscValue() & int32(1 << x)) if (GetMiscValue() & int32(1 << x))
{
target->HandleStatModifier(UnitMods(UNIT_MOD_RESISTANCE_START + x), BASE_PCT, float(GetAmount()), apply); target->HandleStatModifier(UnitMods(UNIT_MOD_RESISTANCE_START + x), BASE_PCT, float(GetAmount()), apply);
} }
} }
@@ -3998,10 +3989,6 @@ void AuraEffect::HandleModBaseResistance(AuraApplication const* aurApp, uint8 mo
return; return;
Unit* target = aurApp->GetTarget(); Unit* target = aurApp->GetTarget();
// only players and pets have base stats
if (target->IsPlayer() || target->IsPet())
{
for (uint8 i = SPELL_SCHOOL_NORMAL; i < MAX_SPELL_SCHOOL; i++) for (uint8 i = SPELL_SCHOOL_NORMAL; i < MAX_SPELL_SCHOOL; i++)
{ {
if (GetMiscValue() & (1 << i)) if (GetMiscValue() & (1 << i))
@@ -4010,7 +3997,6 @@ void AuraEffect::HandleModBaseResistance(AuraApplication const* aurApp, uint8 mo
} }
} }
} }
}
void AuraEffect::HandleModTargetResistance(AuraApplication const* aurApp, uint8 mode, bool apply) const void AuraEffect::HandleModTargetResistance(AuraApplication const* aurApp, uint8 mode, bool apply) const
{ {