mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 01:37:00 +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()
|
||||
|
|
|
|||
|
|
@ -43,8 +43,6 @@ class MANGOS_DLL_SPEC PathMovementBase
|
|||
PathMovementBase() : i_currentNode(0) {}
|
||||
virtual ~PathMovementBase() {};
|
||||
|
||||
bool MovementInProgress(void) const { return (i_currentNode+1) < i_path->size(); }
|
||||
|
||||
// template pattern, not defined .. override required
|
||||
void LoadPath(T &);
|
||||
uint32 GetCurrentNode() const { return i_currentNode; }
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "11781"
|
||||
#define REVISION_NR "11782"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue