Core/SAI: Fix SMART_ACTION_WP_PAUSE with 0 delay pausing the path only for 1 world loop update
Port From (https://github.com/TrinityCore/TrinityCore/commit/60519e947f634f12aa93a1871d53e012ed9e57d2)
This commit is contained in:
@@ -991,7 +991,8 @@ namespace Game.AI
|
|||||||
// handle pause
|
// handle pause
|
||||||
if (HasEscortState(SmartEscortState.Paused) && (_waypointReached || _waypointPauseForced))
|
if (HasEscortState(SmartEscortState.Paused) && (_waypointReached || _waypointPauseForced))
|
||||||
{
|
{
|
||||||
if (!me.IsInCombat() && !HasEscortState(SmartEscortState.Returning))
|
// Resume only if there was a pause timer set
|
||||||
|
if (_waypointPauseTimer != 0 && !me.IsInCombat() && !HasEscortState(SmartEscortState.Returning))
|
||||||
{
|
{
|
||||||
if (_waypointPauseTimer <= diff)
|
if (_waypointPauseTimer <= diff)
|
||||||
ResumePath();
|
ResumePath();
|
||||||
|
|||||||
@@ -1383,7 +1383,7 @@ namespace Game.AI
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
uint delay = e.Action.wpPause.delay;
|
uint delay = e.Action.wpPause.delay;
|
||||||
((SmartAI)_me.GetAI()).PausePath(delay, e.GetEventType() != SmartEvents.WaypointReached);
|
((SmartAI)_me.GetAI()).PausePath(delay, true);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case SmartActions.WpStop:
|
case SmartActions.WpStop:
|
||||||
@@ -1402,7 +1402,8 @@ namespace Game.AI
|
|||||||
if (!IsSmart())
|
if (!IsSmart())
|
||||||
break;
|
break;
|
||||||
|
|
||||||
((SmartAI)_me.GetAI()).SetWPPauseTimer(0);
|
// Set the timer to 1 ms so the path will be resumed on next update loop
|
||||||
|
((SmartAI)_me.GetAI()).SetWPPauseTimer(1);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case SmartActions.SetOrientation:
|
case SmartActions.SetOrientation:
|
||||||
|
|||||||
Reference in New Issue
Block a user