[11782] fix the issue in FlightPathMovementGenerator that event for last path point was not processed

This commit is contained in:
SilverIce 2011-09-02 14:02:26 +03:00
parent de54e63f7a
commit 7c49e4afb6
3 changed files with 13 additions and 10 deletions

View file

@ -313,15 +313,20 @@ void FlightPathMovementGenerator::Reset(Player & player)
bool FlightPathMovementGenerator::Update(Player &player, const uint32 &diff)
{
uint32 pointId = (uint32)player.movespline->currentPathIdx();
// currentPathIdx returns lastIdx + 1 at arrive
while (i_currentNode < pointId)
if (pointId > i_currentNode)
{
DoEventIfAny(player,(*i_path)[i_currentNode],true);
DoEventIfAny(player,(*i_path)[i_currentNode],false);
++i_currentNode;
bool departureEvent = true;
do
{
DoEventIfAny(player,(*i_path)[i_currentNode],departureEvent);
if (pointId == i_currentNode)
break;
i_currentNode += (uint32)departureEvent;
departureEvent = !departureEvent;
} while(true);
}
return MovementInProgress();
return i_currentNode < (i_path->size()-1);
}
void FlightPathMovementGenerator::SetCurrentNodeAfterTeleport()