aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Movement/MotionMaster.cpp
diff options
context:
space:
mode:
authortreeston <treeston.mmoc@gmail.com>2016-09-21 16:22:12 +0200
committertreeston <treeston.mmoc@gmail.com>2016-09-21 16:22:12 +0200
commitd3214a0012cf93a5e66d1dc405ac90c4abc1b8c3 (patch)
treeec9f3edf4cd968d2c67fd6a800491b5092b0b7f9 /src/server/game/Movement/MotionMaster.cpp
parent820e8433917fe27c4a1093482532c6986b519e1f (diff)
Movement/SplineChain: Streamline the script workflow for resume info a bit, provide static method that does all the ugly pointer casts for you. Also prevent a nullptr dereference crash if scripts mishandle motionmaster, and canonize Chain == nullptr to signify "no resume info".
Diffstat (limited to 'src/server/game/Movement/MotionMaster.cpp')
-rw-r--r--src/server/game/Movement/MotionMaster.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/server/game/Movement/MotionMaster.cpp b/src/server/game/Movement/MotionMaster.cpp
index 113c403d9fb..4ad2a314111 100644
--- a/src/server/game/Movement/MotionMaster.cpp
+++ b/src/server/game/Movement/MotionMaster.cpp
@@ -494,6 +494,11 @@ void MotionMaster::MoveAlongSplineChain(uint32 pointId, SplineChain const& chain
void MotionMaster::ResumeSplineChain(SplineChainResumeInfo const& info)
{
+ if (info.Empty())
+ {
+ TC_LOG_ERROR("misc", "MotionMaster::ResumeSplineChain: unit with entry %u tried to resume a spline chain from empty info.", _owner->GetEntry());
+ return;
+ }
Mutate(new SplineChainMovementGenerator(info), MOTION_SLOT_ACTIVE);
}