aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorccrs <ccrs@users.noreply.github.com>2019-10-22 15:48:00 +0200
committerShauren <shauren.trinity@gmail.com>2021-12-18 23:14:40 +0100
commita59e4da7f5d49c9a726443896218f7ae3e3d74e8 (patch)
tree238e2d93b5208aafad268bbe265da236b70e9b22
parent8281c92dceeb11e6d7324b7d08dbad38516c153d (diff)
Core/Movement: d033032 followup
ty jackpoz (cherry picked from commit 5d056f37c74b652b3a3372d6aa88ac5e183f9d98)
-rw-r--r--src/server/game/Movement/MotionMaster.cpp7
-rw-r--r--src/server/game/Movement/MotionMaster.h1
2 files changed, 6 insertions, 2 deletions
diff --git a/src/server/game/Movement/MotionMaster.cpp b/src/server/game/Movement/MotionMaster.cpp
index 14d0046cf45..5c045a79049 100644
--- a/src/server/game/Movement/MotionMaster.cpp
+++ b/src/server/game/Movement/MotionMaster.cpp
@@ -118,9 +118,12 @@ void MotionMaster::AddToWorld()
if (!HasFlag(MOTIONMASTER_FLAG_INITIALIZATION_PENDING))
return;
+ AddFlag(MOTIONMASTER_FLAG_INITIALIZING);
+ RemoveFlag(MOTIONMASTER_FLAG_INITIALIZATION_PENDING);
+
ResolveDelayedActions();
- RemoveFlag(MOTIONMASTER_FLAG_INITIALIZATION_PENDING);
+ RemoveFlag(MOTIONMASTER_FLAG_INITIALIZING);
}
bool MotionMaster::Empty() const
@@ -287,7 +290,7 @@ void MotionMaster::Update(uint32 diff)
if (!_owner)
return;
- if (HasFlag(MOTIONMASTER_FLAG_INITIALIZATION_PENDING))
+ if (HasFlag(MOTIONMASTER_FLAG_INITIALIZATION_PENDING | MOTIONMASTER_FLAG_INITIALIZING))
return;
ASSERT(!Empty(), "MotionMaster:Update: update called without Initializing! (%s)", _owner->GetGUID().ToString().c_str());
diff --git a/src/server/game/Movement/MotionMaster.h b/src/server/game/Movement/MotionMaster.h
index 61069cf4cf4..c5629dba09d 100644
--- a/src/server/game/Movement/MotionMaster.h
+++ b/src/server/game/Movement/MotionMaster.h
@@ -49,6 +49,7 @@ enum MotionMasterFlags : uint8
MOTIONMASTER_FLAG_UPDATE = 0x1, // Update in progress
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_INITIALIZING = 0x8, // MotionMaster is initializing
MOTIONMASTER_FLAG_DELAYED = MOTIONMASTER_FLAG_STATIC_INITIALIZATION_PENDING | MOTIONMASTER_FLAG_INITIALIZATION_PENDING
};