fix(Scripts/Spells): Seal of Command cannot be casted on dead targets (#6186)

- Closes #5517
- Closes https://github.com/chromiecraft/chromiecraft/issues/476
This commit is contained in:
UltraNix 2021-06-09 17:56:45 +02:00 committed by GitHub
parent 7106e66421
commit a61bdc7b3d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -103,7 +103,13 @@ public:
if (procSpell->IsAffectingArea())
targets = 1;
eventInfo.GetActor()->CastCustomSpell(aurEff->GetSpellInfo()->Effects[EFFECT_0].TriggerSpell, SPELLVALUE_MAX_TARGETS, targets, eventInfo.GetActionTarget(), false, nullptr, aurEff);
if (Unit* target = eventInfo.GetActionTarget())
{
if (target->IsAlive())
{
eventInfo.GetActor()->CastCustomSpell(aurEff->GetSpellInfo()->Effects[EFFECT_0].TriggerSpell, SPELLVALUE_MAX_TARGETS, targets, target, false, nullptr, aurEff);
}
}
}
void Register() override