mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-20 01:15:35 +01:00
Core/Spells Make certain spells (e.g. Mind Control) properly flag the caster for PvP (#17145)
* This issue was caused by PvP-flagging being done calculated after the target's flag was turned off by becoming a pet.
(cherry picked from commit e7a12edb83)
This commit is contained in:
committed by
joschiwald
parent
a2ee7e16ec
commit
1c60553df0
@@ -2356,8 +2356,13 @@ void Spell::DoAllEffectOnTarget(TargetInfo* target)
|
||||
PrepareScriptHitHandlers();
|
||||
CallScriptBeforeHitHandlers(missInfo);
|
||||
|
||||
bool enablePvP = false; // need to check PvP state before spell effects, but act on it afterwards
|
||||
|
||||
if (spellHitTarget)
|
||||
{
|
||||
// if target is flagged for pvp also flag caster if a player
|
||||
if (unit->IsPvP() && m_caster->GetTypeId() == TYPEID_PLAYER)
|
||||
enablePvP = true; // Decide on PvP flagging now, but act on it later.
|
||||
SpellMissInfo missInfo2 = DoSpellHitOnUnit(spellHitTarget, mask, target->scaleAura);
|
||||
|
||||
if (missInfo2 != SPELL_MISS_NONE)
|
||||
@@ -2511,8 +2516,7 @@ void Spell::DoAllEffectOnTarget(TargetInfo* target)
|
||||
// Needs to be called after dealing damage/healing to not remove breaking on damage auras
|
||||
DoTriggersOnSpellHit(spellHitTarget, mask);
|
||||
|
||||
// if target is fallged for pvp also flag caster if a player
|
||||
if (unit->IsPvP() && m_caster->GetTypeId() == TYPEID_PLAYER)
|
||||
if (enablePvP)
|
||||
m_caster->ToPlayer()->UpdatePvP(true);
|
||||
|
||||
CallScriptAfterHitHandlers();
|
||||
|
||||
Reference in New Issue
Block a user