From 1bf8b0e91d914df4229dfbf50889ebb3b5ad096b Mon Sep 17 00:00:00 2001 From: beu Date: Tue, 8 Jul 2025 17:08:50 +0200 Subject: [PATCH] keep bots instead of removing them at map start --- TM_ControllerBenchmark.Script.txt | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/TM_ControllerBenchmark.Script.txt b/TM_ControllerBenchmark.Script.txt index 9151a4e..5254c28 100644 --- a/TM_ControllerBenchmark.Script.txt +++ b/TM_ControllerBenchmark.Script.txt @@ -16,9 +16,17 @@ declare Integer Map_CheckConnectPlayer; ***Match_StartMap*** *** if (ServerAdmin != Null) { - MB_Sleep(500); // Wait a bit before if bot already exits - log("Spawning " ^ServerAdmin.ServerInfo.MaxPlayerCount - 5 - Players.count ^ " bots"); - Users_SetNbFakeUsers(ML::Max(0, ServerAdmin.ServerInfo.MaxPlayerCount - 5 - Players.count) , 0); + MB_Sleep(500); // Wait a bit before if bot already exists + + declare Integer CurrentNbOfBots; + foreach (Player in AllPlayers) { + if (Player.IsFakePlayer) CurrentNbOfBots += 1; + } + + declare Integer NbBots = ServerAdmin.ServerInfo.MaxPlayerCount - 5 - Players.count + CurrentNbOfBots; + + log("Spawning "^ NbBots ^" bots"); + Users_SetNbFakeUsers(ML::Max(0, NbBots) , 0); } if (RandomizedFakePlayersEnabled()) Map_CheckConnectPlayer = Now + ML::Rand(1000,120000); ***