added option to skip bot_scaling to use bot_static instead for spawning static amount of bots each round if wanted

This commit is contained in:
2024-02-25 00:23:58 +01:00
parent 592d3b4c15
commit 8c80d4ac05
2 changed files with 134 additions and 114 deletions
+13 -6
View File
@@ -1275,7 +1275,15 @@ public void LoadWave(int wave)
g_iClientRespawnCountNum = kv.GetNum("Respawns", 5);
l_iBotQuote = kv.GetNum("bot_scaling", 1);
SettingBotQoute(l_iBotQuote);
int l_iBotQuoteStatic = kv.GetNum("bot_static", 1);
if (l_iBotQuote == 0) //we use static bot amount instead
{
SettingBotQoute(l_iBotQuoteStatic, true);
}
else
{
SettingBotQoute(l_iBotQuote, false);
}
while (!IsEndOfFile(l_hFile) && ReadFileLine(l_hFile, l_cLine, sizeof(l_cLine)))
{
if (StrContains(l_cLine, l_cJumptokey) == -1 && !l_bKeyIndex)
@@ -1418,7 +1426,7 @@ public void LoadWave(int wave)
//----------------------------------------------------------------------------------------------------
// Purpose:
//----------------------------------------------------------------------------------------------------
public void SettingBotQoute(int botscale)
public void SettingBotQoute(int botscale, bool bot_static)
{
int l_iPlayers;
for (int i = 1; i < MaxClients; i++)
@@ -1428,14 +1436,13 @@ public void SettingBotQoute(int botscale)
l_iPlayers++;
}
}
if (botscale > 0)
if (bot_static)
{
addBots(l_iPlayers * botscale);
addBots(botscale);
}
else
{
//bot_scaling 0 should imply we spawn zombie_count amount of bots instead of scaling bots to player amount.
addBots(g_iZMCount);
addBots(l_iPlayers * botscale);
}
}
//----------------------------------------------------------------------------------------------------