Core/Movement: fixed taxi pathings getting finalized earlier than intended

Port From (https://github.com/TrinityCore/TrinityCore/commit/091084353869b843f700969e017746310492bdf6)
This commit is contained in:
hondacrx
2022-01-04 20:48:33 -05:00
parent 3cd3827d48
commit cf0ddc132b
@@ -74,8 +74,9 @@ namespace Game.Movement
if (owner == null) if (owner == null)
return false; return false;
uint pointId = (uint)(owner.MoveSpline.CurrentPathIdx() < 0 ? 0 : owner.MoveSpline.CurrentPathIdx()); // skipping the first spline path point because it's our starting point and not a taxi path point
if (pointId > _currentNode && _currentNode < _path.Count) uint pointId = (uint)(owner.MoveSpline.CurrentPathIdx() <= 0 ? 0 : owner.MoveSpline.CurrentPathIdx() - 1);
if (pointId > _currentNode && _currentNode < _path.Count - 1)
{ {
bool departureEvent = true; bool departureEvent = true;
do do
@@ -92,7 +93,7 @@ namespace Game.Movement
} }
} }
if (pointId >= _currentNode) if (pointId == _currentNode)
break; break;
if (_currentNode == _preloadTargetNode) if (_currentNode == _preloadTargetNode)
@@ -101,7 +102,7 @@ namespace Game.Movement
_currentNode += (departureEvent ? 1 : 0); _currentNode += (departureEvent ? 1 : 0);
departureEvent = !departureEvent; departureEvent = !departureEvent;
} }
while (true); while (_currentNode < _path.Count - 1);
} }
if (_currentNode >= (_path.Count - 1)) if (_currentNode >= (_path.Count - 1))
@@ -262,10 +263,6 @@ namespace Game.Movement
Log.outDebug(LogFilter.Server, "FlightPathMovementGenerator::PreloadEndGrid: Unable to determine map to preload flightmaster grid"); Log.outDebug(LogFilter.Server, "FlightPathMovementGenerator::PreloadEndGrid: Unable to determine map to preload flightmaster grid");
} }
public override bool GetResetPosition(Unit u, out float x, out float y, out float z) public override bool GetResetPosition(Unit u, out float x, out float y, out float z)
{ {
var node = _path[_currentNode]; var node = _path[_currentNode];