From: Dmitry D. Chernov Date: Sat, 15 Jul 2023 12:07:09 +0000 (+1000) Subject: Assign a bot team randomly if it's not explicitly specified in its preset X-Git-Url: http://deadsoftware.ru/gitweb?p=d2df-sdl.git;a=commitdiff_plain;h=ca23794a6f2dc5eb454f65fc53efc265f16de612 Assign a bot team randomly if it's not explicitly specified in its preset --- 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);