fix(Core/Spells): possible crashes within class spells (#9168)

This commit is contained in:
Nefertumm 2021-11-21 11:41:51 -03:00 committed by GitHub
parent 92b3617f63
commit 61c7488698
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 66 additions and 25 deletions

View file

@ -150,7 +150,7 @@ class spell_warr_improved_spell_reflection : public AuraScript
bool CheckProc(ProcEventInfo& eventInfo)
{
return eventInfo.GetSpellInfo() && eventInfo.GetSpellInfo()->Id == SPELL_WARRIOR_SPELL_REFLECTION;
return eventInfo.GetSpellInfo() && eventInfo.GetActor() && eventInfo.GetSpellInfo()->Id == SPELL_WARRIOR_SPELL_REFLECTION;
}
void OnProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
@ -623,6 +623,11 @@ class spell_warr_sweeping_strikes : public AuraScript
bool CheckProc(ProcEventInfo& eventInfo)
{
if (!eventInfo.GetActor() || eventInfo.GetProcTarget())
{
return false;
}
_procTarget = eventInfo.GetActor()->SelectNearbyNoTotemTarget(eventInfo.GetProcTarget());
DamageInfo* damageInfo = eventInfo.GetDamageInfo();
@ -801,6 +806,11 @@ class spell_warr_retaliation : public AuraScript
bool CheckProc(ProcEventInfo& eventInfo)
{
if (!eventInfo.GetActor() || !eventInfo.GetProcTarget())
{
return false;
}
// check attack comes not from behind and warrior is not stunned
return GetTarget()->isInFront(eventInfo.GetActor(), M_PI) && !GetTarget()->HasUnitState(UNIT_STATE_STUNNED);
}