Core/Spells: Correct flagging spell caster for pvp when healing/buffing friendly creatures - it should only happen if target is in combat

Port From (https://github.com/TrinityCore/TrinityCore/commit/84996901ccb22e2a82745d469f3560f7574a64c5)
This commit is contained in:
hondacrx
2022-06-15 18:24:55 -04:00
parent c26e78c902
commit 3682957f4c
+2 -1
View File
@@ -8269,8 +8269,9 @@ namespace Game.Spells
unit.SetInCombatWith(spell.GetCaster().ToPlayer());
// if target is flagged for pvp also flag caster if a player
// but respect current pvp rules (buffing/healing npcs flagged for pvp only flags you if they are in combat)
_enablePVP = (MissCondition == SpellMissInfo.None || spell.m_spellInfo.HasAttribute(SpellAttr3.PvpEnabling))
&& unit.IsPvP() && spell.GetCaster().IsPlayer(); // need to check PvP state before spell effects, but act on it afterwards
&& unit.IsPvP() && (unit.IsInCombat() || unit.IsCharmedOwnedByPlayerOrPlayer()) && spell.GetCaster().IsPlayer(); // need to check PvP state before spell effects, but act on it afterwards
if (_spellHitTarget)
{