aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorccrs <ccrs@users.noreply.github.com>2019-10-22 15:48:00 +0200
committerccrs <ccrs@users.noreply.github.com>2019-10-22 15:48:00 +0200
commit5d056f37c74b652b3a3372d6aa88ac5e183f9d98 (patch)
treecc9428abd7fd24929da5913fc0e32f6fd885701d
parente10cab89f7173844b08b1bd7b3f4b7317a749b41 (diff)
Core/Movement: d033032 followup
ty jackpoz
-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 0cb7e3811c3..b2e2f1bbd43 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 b6224b30a4e..cd6068d79f0 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
};