From b155209ec40f867fc90d64eb207f3d3e7f633c2b Mon Sep 17 00:00:00 2001 From: Jinnaix <37972361+Jinnaix@users.noreply.github.com> Date: Thu, 9 Jun 2022 11:33:30 +0200 Subject: Core/Spells: Correct flagging spell caster for pvp when healing/buffing friendly creatures - it should only happen if target is in combat (#27977) --- src/server/game/Spells/Spell.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 1c0042b06dc..d475620a4c9 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -2322,7 +2322,8 @@ void Spell::TargetInfo::PreprocessTarget(Spell* spell) if (_spellHitTarget) { // if target is flagged for pvp also flag caster if a player - if (unit->IsPvP() && spell->m_caster->GetTypeId() == TYPEID_PLAYER) + // but respect current pvp rules (buffing/healing npcs flagged for pvp only flags you if they are in combat) + if (unit->IsPvP() && (unit->IsInCombat() || unit->IsCharmedOwnedByPlayerOrPlayer()) && spell->m_caster->GetTypeId() == TYPEID_PLAYER) _enablePVP = true; // Decide on PvP flagging now, but act on it later. SpellMissInfo missInfo = spell->PreprocessSpellHit(_spellHitTarget, ScaleAura, *this); -- cgit v1.2.3