Core/Movement: fixed taxi pathings getting finalized earlier than intended (#23830)

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

Since we handle the intial starting point of a spline properly now the update logic was still expecting the old handling which resulted in incrementing the current node index earlier than intended

* apply a missing change
This commit is contained in:
Ovah
2019-09-28 09:24:41 +02:00
committed by Giacomo Pozzoni
parent ca8953a0ec
commit c1e3d79a4f

View File

@@ -94,8 +94,9 @@ bool FlightPathMovementGenerator::DoUpdate(Player* owner, uint32 /*diff*/)
if (!owner)
return false;
uint32 pointId = owner->movespline->currentPathIdx() < 0 ? 0 : owner->movespline->currentPathIdx();
if (pointId > _currentNode && _currentNode < _path.size())
// skipping the first spline path point because it's our starting point and not a taxi path point
uint32 pointId = owner->movespline->currentPathIdx() <= 0 ? 0 : owner->movespline->currentPathIdx() - 1;
if (pointId > _currentNode && _currentNode < _path.size() - 1)
{
bool departureEvent = true;
do
@@ -122,7 +123,7 @@ bool FlightPathMovementGenerator::DoUpdate(Player* owner, uint32 /*diff*/)
_currentNode += departureEvent ? 1 : 0;
departureEvent = !departureEvent;
} while (_currentNode < _path.size());
} while (_currentNode < _path.size() - 1);
}
if (_currentNode >= (_path.size() - 1))