Fixed a potential crash when resuming a SplineChainMovementGenerator.

Port From (https://github.com/TrinityCore/TrinityCore/commit/8eaf00a11f5276bf56d023a8bce11fc881466eec)
This commit is contained in:
hondacrx
2020-07-23 18:23:01 -04:00
parent 286a200178
commit 941bf02e31
@@ -93,7 +93,9 @@ namespace Game.Movement
SendPathSpline(me, span.Slice(_nextFirstWP - 1));
Log.outDebug(LogFilter.Movement, "{0}: Resumed spline chain generator from resume state.", me.GetGUID().ToString());
++_nextIndex;
if (_msToNext == 0)
if (_nextIndex >= _chainSize)
_msToNext = 0;
else if (_msToNext == 0)
_msToNext = 1;
_nextFirstWP = 0;
}