From 2dfafa69ebc422feba1aa01e0c4fab76366f552f Mon Sep 17 00:00:00 2001 From: treeston Date: Sun, 9 Jul 2017 02:07:29 +0200 Subject: Hi, I'm Treeston, and welcome to Combat PR Prep Refactors. Today, we're moving UNIT_FLAG_IMMUNE_TO_PC and UNIT_FLAG_IMMUNE_TO_NPC to higher-level abstraction so combat manager can react to it. New methods on Unit: - void SetImmuneTo(apply, keepCombat = false); - bool IsImmuneTo() const; (cherry picked from commit 74af880217fc567c9949d7557408718af889402f) --- src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/server/game/AI/ScriptedAI') diff --git a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp index c8ecf527f21..fc0ed3fa9e0 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp +++ b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp @@ -188,7 +188,7 @@ void npc_escortAI::EnterEvadeMode(EvadeReason /*why*/) { me->GetMotionMaster()->MoveTargetedHome(); if (HasImmuneToNPCFlags) - me->AddUnitFlag(UNIT_FLAG_IMMUNE_TO_NPC); + me->SetImmuneToNPC(true); Reset(); } } @@ -472,10 +472,10 @@ void npc_escortAI::Start(bool isActiveAttacker /* = true*/, bool run /* = false //disable npcflags me->SetNpcFlags(UNIT_NPC_FLAG_NONE); me->SetNpcFlags2(UNIT_NPC_FLAG_2_NONE); - if (me->HasUnitFlag(UNIT_FLAG_IMMUNE_TO_NPC)) + if (me->IsImmuneToNPC()) { HasImmuneToNPCFlags = true; - me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_NPC); + me->SetImmuneToNPC(false); } TC_LOG_DEBUG("scripts", "EscortAI started with " UI64FMTD " waypoints. ActiveAttacker = %d, Run = %d, %s", uint64(WaypointList.size()), m_bIsActiveAttacker, m_bIsRunning, m_uiPlayerGUID.ToString().c_str()); -- cgit v1.2.3