mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 19:37:02 +00:00
[11782] fix the issue in FlightPathMovementGenerator that event for last path point was not processed
This commit is contained in:
parent
de54e63f7a
commit
7c49e4afb6
3 changed files with 13 additions and 10 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue