From ca23794a6f2dc5eb454f65fc53efc265f16de612 Mon Sep 17 00:00:00 2001 From: "Dmitry D. Chernov" Date: Sat, 15 Jul 2023 22:07:09 +1000 Subject: [PATCH] Assign a bot team randomly if it's not explicitly specified in its preset --- src/game/g_player.pas | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/game/g_player.pas b/src/game/g_player.pas index 0990c0e..1468551 100644 --- a/src/game/g_player.pas +++ b/src/game/g_player.pas @@ -1271,12 +1271,17 @@ begin model := config.ReadStr(IntToStr(a), 'model', ''); // Ìîäåëü // Êîìàíäà - if config.ReadStr(IntToStr(a), 'team', 'red') = 'red' - then team := TEAM_RED - else team := TEAM_BLUE; + s := config.ReadStr(IntToStr(a), 'team', ''); + if s = 'red' then + team := TEAM_RED + else if s = 'blue' then + team := TEAM_BLUE + else + team := TEAM_NONE; // Öâåò ìîäåëè sa := parse(config.ReadStr(IntToStr(a), 'color', '')); + SetLength(sa, 3); color.R := StrToIntDef(sa[0], 0); color.G := StrToIntDef(sa[1], 0); color.B := StrToIntDef(sa[2], 0); -- 2.29.2