When "MovePos" exists, always refresh it.
If not do this, in "BotFinalizeCurrentOrder()" func, 'nextPos' may be equal to 'CurrentOrder.DestPos', and bots will not refresh the move command. In testing, bots often ran back to human, after a few secends they start lead order again.
::Left4Bots.AIFuncs.BotOnResume <- function ()
{
L4B.Logger.Debug("[AI]" + self.GetPlayerName() + " [->]");
if (L4B.Settings.pause_debug)
Say(self, "[->]", false);
if (MovePos)
NeedMove = 2; // Refresh previous MOVE
if (MoveType == AI_MOVE_TYPE.Order && CurrentOrder.OrderType == "lead")
{
if (CurrentOrder.DestPos)
{
// If we are executing a "lead" order and, during the pause, we moved ahead of the next position, the last MOVE will take us backwards. Better finalize the order to re-calc the next position from here
BotFinalizeCurrentOrder();
}
if ((CurTime - L4B.LastLeadStartVocalize) >= L4B.Settings.lead_vocalize_interval)
{
L4B.SpeakRandomVocalize(self, L4B.VocalizerLeadStart, RandomFloat(0.4, 0.9));
L4B.LastLeadStartVocalize = CurTime;
}
}
}
When "MovePos" exists, always refresh it. If not do this, in "BotFinalizeCurrentOrder()" func, 'nextPos' may be equal to 'CurrentOrder.DestPos', and bots will not refresh the move command. In testing, bots often ran back to human, after a few secends they start lead order again.