aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Movement/MotionMaster.h
diff options
context:
space:
mode:
authorccrs <ccrs@users.noreply.github.com>2019-10-21 13:55:23 +0200
committerShauren <shauren.trinity@gmail.com>2021-12-18 23:03:00 +0100
commitdfb2221552048512b4fda0c7e0c97ecf808106f9 (patch)
tree900f9525bd740471d3c18c80787d85c84ee105e9 /src/server/game/Movement/MotionMaster.h
parent7f074efa0498f9c0a8b8eaed733f462763ae099d (diff)
Core/Movement: delay movement update in MotionMaster until its owner signals AddToWorld
ref #23199 closes #23876 (cherry picked from commit d033032d33cff5dae76000f8432d78746cda9e06)
Diffstat (limited to 'src/server/game/Movement/MotionMaster.h')
-rw-r--r--src/server/game/Movement/MotionMaster.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/server/game/Movement/MotionMaster.h b/src/server/game/Movement/MotionMaster.h
index 65f4dcbc540..61069cf4cf4 100644
--- a/src/server/game/Movement/MotionMaster.h
+++ b/src/server/game/Movement/MotionMaster.h
@@ -47,7 +47,10 @@ enum MotionMasterFlags : uint8
{
MOTIONMASTER_FLAG_NONE = 0x0,
MOTIONMASTER_FLAG_UPDATE = 0x1, // Update in progress
- MOTIONMASTER_FLAG_STATIC_INITIALIZATION_PENDING = 0x2
+ MOTIONMASTER_FLAG_STATIC_INITIALIZATION_PENDING = 0x2, // Static movement (MOTION_SLOT_DEFAULT) hasn't been initialized
+ MOTIONMASTER_FLAG_INITIALIZATION_PENDING = 0x4, // MotionMaster is stalled until signaled
+
+ MOTIONMASTER_FLAG_DELAYED = MOTIONMASTER_FLAG_STATIC_INITIALIZATION_PENDING | MOTIONMASTER_FLAG_INITIALIZATION_PENDING
};
enum MotionMasterDelayedActionType : uint8
@@ -112,6 +115,7 @@ class TC_GAME_API MotionMaster
void Initialize();
void InitializeDefault();
+ void AddToWorld();
bool Empty() const;
uint32 Size() const;
@@ -199,6 +203,7 @@ class TC_GAME_API MotionMaster
bool HasFlag(uint8 const flag) const { return (_flags & flag) != 0; }
void RemoveFlag(uint8 const flag) { _flags &= ~flag; }
+ void ResolveDelayedActions();
void Remove(MotionMasterContainer::iterator iterator, bool active, bool movementInform);
void Pop(bool active, bool movementInform);
void DirectInitialize();