Fixed a potential crash when resuming a SplineChainMovementGenerator.

(cherry picked from commit e5301e2c98)
This commit is contained in:
treeston
2017-06-08 15:34:35 +02:00
committed by Carbenium
parent 51ce3b1c1d
commit 8eaf00a11f

View File

@@ -71,7 +71,9 @@ void SplineChainMovementGenerator::Initialize(Unit* me)
SendPathSpline(me, partial);
TC_LOG_DEBUG("movement.splinechain", "%s: Resumed spline chain generator from resume state.", me->GetGUID().ToString().c_str());
++_nextIndex;
if (!_msToNext)
if (_nextIndex >= _chainSize)
_msToNext = 0;
else if (!_msToNext)
_msToNext = 1;
_nextFirstWP = 0;
}