mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/MovementGenerator: Fix crash in taxi paths
Fix a crash in taxi paths happening when joining a battleground/dungeon while on a taxi path after second last node but close to last node, then leaving/finishing the battleground.
(cherry picked from commit 680e1cbd6c)
This commit is contained in:
@@ -97,7 +97,7 @@ bool FlightPathMovementGenerator::DoUpdate(Player* owner, uint32 /*diff*/)
|
||||
return false;
|
||||
|
||||
uint32 pointId = owner->movespline->currentPathIdx() < 0 ? 0 : owner->movespline->currentPathIdx();
|
||||
if (pointId > _currentNode)
|
||||
if (pointId > _currentNode && _currentNode < _path.size())
|
||||
{
|
||||
bool departureEvent = true;
|
||||
do
|
||||
@@ -116,7 +116,7 @@ bool FlightPathMovementGenerator::DoUpdate(Player* owner, uint32 /*diff*/)
|
||||
}
|
||||
}
|
||||
|
||||
if (pointId == _currentNode)
|
||||
if (pointId >= _currentNode)
|
||||
break;
|
||||
|
||||
if (_currentNode == _preloadTargetNode)
|
||||
|
||||
Reference in New Issue
Block a user