diff options
| author | Shauren <shauren.trinity@gmail.com> | 2022-03-29 11:30:49 +0200 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2022-03-29 11:30:49 +0200 |
| commit | d611925dc7ab2b3f19c5ee9e0f75b8dfb6de1291 (patch) | |
| tree | 4428ac0728c043ca1cb4fc55427f87268ab4860c /src/server/game/AI/ScriptedAI | |
| parent | c02b829788cb274a68b125aee4dab35b9a56a2b8 (diff) | |
Core/Units: Reduce differences between branches part 1 - unit updatefield accessors
Diffstat (limited to 'src/server/game/AI/ScriptedAI')
| -rw-r--r-- | src/server/game/AI/ScriptedAI/ScriptedCreature.cpp | 8 | ||||
| -rw-r--r-- | src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp | 2 | ||||
| -rw-r--r-- | src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp | 2 |
3 files changed, 6 insertions, 6 deletions
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); |
