aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/AI/ScriptedAI
diff options
context:
space:
mode:
authortreeston <treeston.mmoc@gmail.com>2017-07-09 02:07:29 +0200
committertreeston <treeston.mmoc@gmail.com>2017-07-09 02:07:29 +0200
commit74af880217fc567c9949d7557408718af889402f (patch)
tree7a39bedb3fbd1a618413ef60ca390c94f4298fea /src/server/game/AI/ScriptedAI
parentc6d799444572a6d3023a560d7d1c24b0d7a8d050 (diff)
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<All/PC/NPC>(apply, keepCombat = false); - bool IsImmuneTo<All/PC/NPC>() const;
Diffstat (limited to 'src/server/game/AI/ScriptedAI')
-rw-r--r--src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp
index 30a59109e44..bcf060e2ad6 100644
--- a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp
+++ b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp
@@ -189,7 +189,7 @@ void npc_escortAI::EnterEvadeMode(EvadeReason /*why*/)
{
me->GetMotionMaster()->MoveTargetedHome();
if (HasImmuneToNPCFlags)
- me->SetFlag(UNIT_FIELD_FLAGS, 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->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE);
- if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_NPC))
+ if (me->IsImmuneToNPC())
{
HasImmuneToNPCFlags = true;
- me->RemoveFlag(UNIT_FIELD_FLAGS, 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());