Core/Spells: fix penance and holy shock targetting for non faction friendly npcs that appear friendly. should also fix the issue with using mixed groups
This commit is contained in:
1 parent
bf7a32b79e
commit
b5a5080df0
2 files changed
+4
-4
No files matched your search
@@ -228,8 +228,8 @@ class spell_pri_penance : public SpellScriptLoader
|
||||
{
|
||||
Player* caster = GetCaster()->ToPlayer();
|
||||
if (GetTargetUnit())
|
||||
if (Player* target = GetTargetUnit()->ToPlayer())
|
||||
if (caster->GetTeam() != target->GetTeam() && !caster->IsValidAttackTarget(target))
|
||||
if (Unit* target = GetTargetUnit())
|
||||
if (!caster->IsFriendlyTo(target) && !caster->IsValidAttackTarget(target))
|
||||
return SPELL_FAILED_BAD_TARGETS;
|
||||
return SPELL_CAST_OK;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user