From d611925dc7ab2b3f19c5ee9e0f75b8dfb6de1291 Mon Sep 17 00:00:00 2001 From: Shauren Date: Tue, 29 Mar 2022 11:30:49 +0200 Subject: Core/Units: Reduce differences between branches part 1 - unit updatefield accessors --- src/server/game/AI/ScriptedAI/ScriptedCreature.cpp | 8 ++++---- src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp | 2 +- src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src/server/game/AI/ScriptedAI') diff --git a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp index 0f1260bf1fc..4625876abb9 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp +++ b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp @@ -305,7 +305,7 @@ SpellInfo const* ScriptedAI::SelectSpell(Unit* target, uint32 school, uint32 mec return nullptr; // Silenced so we can't cast - if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SILENCED)) + if (me->HasUnitFlag(UNIT_FLAG_SILENCED)) return nullptr; // Using the extended script system we first create a list of viable spells @@ -471,13 +471,13 @@ void ScriptedAI::SetEquipmentSlots(bool loadDefault, int32 mainHand /*= EQUIP_NO } if (mainHand >= 0) - me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, uint32(mainHand)); + me->SetVirtualItem(0, uint32(mainHand)); if (offHand >= 0) - me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, uint32(offHand)); + me->SetVirtualItem(1, uint32(offHand)); if (ranged >= 0) - me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 2, uint32(ranged)); + me->SetVirtualItem(2, uint32(ranged)); } void ScriptedAI::SetCombatMovement(bool allowMovement) diff --git a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp index 4ad42066d77..ca5d4c5484e 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp +++ b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp @@ -321,7 +321,7 @@ void EscortAI::Start(bool isActiveAttacker /* = true*/, bool run /* = false */, me->GetMotionMaster()->Clear(MOTION_PRIORITY_NORMAL); // disable npcflags - me->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE); + me->ReplaceAllNpcFlags(UNIT_NPC_FLAG_NONE); if (me->IsImmuneToNPC()) { _hasImmuneToNPCFlags = true; diff --git a/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp index d945512a9bf..876e1f4b916 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp +++ b/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp @@ -185,7 +185,7 @@ void FollowerAI::StartFollow(Player* player, uint32 factionForFollower, uint32 q me->GetMotionMaster()->Clear(MOTION_PRIORITY_NORMAL); me->PauseMovement(); - me->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE); + me->ReplaceAllNpcFlags(UNIT_NPC_FLAG_NONE); AddFollowState(STATE_FOLLOW_INPROGRESS); -- cgit v1.2.3