diff options
author | treeston <treeston.mmoc@gmail.com> | 2016-09-21 16:22:12 +0200 |
---|---|---|
committer | joschiwald <joschiwald.trinity@gmail.com> | 2017-03-02 21:10:00 +0100 |
commit | b12f19f066bfd0e968251b3ec77bae2dde40616b (patch) | |
tree | cb1c00c819d72e0f58108415ecdc3587efa3f531 /src/server/game/Movement/MotionMaster.cpp | |
parent | ec9c5b19ac81b238d66794c0a766e3d412600d5d (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".
(cherry picked from commit d3214a0012cf93a5e66d1dc405ac90c4abc1b8c3)
d3214a0 follow-up for code style.
(cherry picked from commit 4deeee66bda390d2b35b64aaeb5924dac4170e10)
Diffstat (limited to 'src/server/game/Movement/MotionMaster.cpp')
-rw-r--r-- | src/server/game/Movement/MotionMaster.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/server/game/Movement/MotionMaster.cpp b/src/server/game/Movement/MotionMaster.cpp index 898e4841559..651efa7f940 100644 --- a/src/server/game/Movement/MotionMaster.cpp +++ b/src/server/game/Movement/MotionMaster.cpp @@ -505,6 +505,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); } |