Core/MovementGenerator: Fix crash in taxi paths

Port From (https://github.com/TrinityCore/TrinityCore/commit/2eea34fb47ade2ab3bf8d46d18a9880a007a2274)
This commit is contained in:
hondacrx
2022-01-04 20:05:19 -05:00
parent b3eb0ef4c5
commit 12c9ea08ac
@@ -75,7 +75,7 @@ namespace Game.Movement
return false; return false;
uint pointId = (uint)(owner.MoveSpline.CurrentPathIdx() < 0 ? 0 : owner.MoveSpline.CurrentPathIdx()); uint pointId = (uint)(owner.MoveSpline.CurrentPathIdx() < 0 ? 0 : owner.MoveSpline.CurrentPathIdx());
if (pointId > _currentNode) if (pointId > _currentNode && _currentNode < _path.Count)
{ {
bool departureEvent = true; bool departureEvent = true;
do do
@@ -92,7 +92,7 @@ namespace Game.Movement
} }
} }
if (pointId == _currentNode) if (pointId >= _currentNode)
break; break;
if (_currentNode == _preloadTargetNode) if (_currentNode == _preloadTargetNode)