Core/Movement: always update the home position to a reached waypoint node instead of only upon reaching the end of a non-repeatable path
This commit is contained in:
1 parent
fb120d761b
commit
b8f74928f4
1 file changed
+3
-2
@@ -123,10 +123,9 @@ void WaypointMovementGenerator<Creature>::ProcessWaypointArrival(Creature* creat
|
||||
_waypointDelay = waypoint.Delay;
|
||||
}
|
||||
|
||||
// Check if the waypoint path has reached its end and may not repeat. Inform AI and update home position.
|
||||
// Check if the waypoint path has reached its end and may not repeat. Inform AI.
|
||||
if ((_currentNode == _path->Nodes.size() - 1) && !_repeating && !_done)
|
||||
{
|
||||
UpdateHomePosition(creature, waypoint);
|
||||
_done = true;
|
||||
creature->UpdateCurrentWaypointInfo(0, 0);
|
||||
|
||||
@@ -135,6 +134,8 @@ void WaypointMovementGenerator<Creature>::ProcessWaypointArrival(Creature* creat
|
||||
AI->WaypointPathEnded(waypoint.Id, _path->Id);
|
||||
}
|
||||
|
||||
UpdateHomePosition(creature, waypoint);
|
||||
|
||||
if (waypoint.EventId && urand(0, 99) < waypoint.EventChance)
|
||||
{
|
||||
TC_LOG_DEBUG("maps.script", "Creature movement start script %u at point %u for %s.", waypoint.EventId, _currentNode, creature->GetGUID().ToString().c_str());
|
||||
|
||||
Reference in new issue
Block a user