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:
@@ -8269,8 +8269,9 @@ namespace Game.Spells
|
|||||||
unit.SetInCombatWith(spell.GetCaster().ToPlayer());
|
unit.SetInCombatWith(spell.GetCaster().ToPlayer());
|
||||||
|
|
||||||
// if target is flagged for pvp also flag caster if a player
|
// 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))
|
_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)
|
if (_spellHitTarget)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user