DEADSOFTWARE

Assign a bot team randomly if it's not explicitly specified in its preset
authorDmitry D. Chernov <blackdoomer@yandex.ru>
Sat, 15 Jul 2023 12:07:09 +0000 (22:07 +1000)
committerDmitry D. Chernov <blackdoomer@yandex.ru>
Sat, 15 Jul 2023 12:07:09 +0000 (22:07 +1000)
src/game/g_player.pas

index 0990c0e5ce43a17ff51a0ff1ff2c6cfe96bdb366..1468551a3c29fcd0ee26e32bc564ed7800559c2d 100644 (file)
@@ -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);