Spells/Penance: If hostile target is not in front, now fails in the initial cast rather than the triggered cast, thus not erroneously causing a cooldown.
This commit is contained in:
1 parent
0f8743a541
commit
403ff21324
1 file changed
+7
-2
@@ -617,8 +617,13 @@ class spell_pri_penance : public SpellScriptLoader
|
||||
{
|
||||
Player* caster = GetCaster()->ToPlayer();
|
||||
if (Unit* target = GetExplTargetUnit())
|
||||
if (!caster->IsFriendlyTo(target) && !caster->IsValidAttackTarget(target))
|
||||
return SPELL_FAILED_BAD_TARGETS;
|
||||
if (!caster->IsFriendlyTo(target))
|
||||
{
|
||||
if (!caster->IsValidAttackTarget(target))
|
||||
return SPELL_FAILED_BAD_TARGETS;
|
||||
if (!caster->isInFront(target))
|
||||
return SPELL_FAILED_UNIT_NOT_INFRONT;
|
||||
}
|
||||
return SPELL_CAST_OK;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user