From 3c0e17ab63db38746eff53276a32d1aebcbfad1b Mon Sep 17 00:00:00 2001 From: "Dmitry D. Chernov" Date: Sat, 15 Jul 2023 19:55:23 +1000 Subject: [PATCH] Fix handicap specifying in the 'bot_addlist' console command Initially introduced by 0bae75d8258116d9079c1b7a4b50f334cc50973e. --- src/game/g_game.pas | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/game/g_game.pas b/src/game/g_game.pas index 29668f5..4fbede4 100644 --- a/src/game/g_game.pas +++ b/src/game/g_game.pas @@ -6559,6 +6559,7 @@ var nm: Boolean; listen: LongWord; found: Boolean; + t: Byte; begin // Îáùèå êîìàíäû: cmd := LowerCase(P[0]); @@ -6990,10 +6991,19 @@ begin begin if Length(P) = 2 then g_Bot_AddList(TEAM_NONE, P[1], StrToIntDef(P[1], -1)) - else if Length(P) = 3 then - g_Bot_AddList(TEAM_NONE, P[1], StrToIntDef(P[1], -1), StrToIntDef(P[2], 100)) else - g_Bot_AddList(IfThen(P[2] = 'red', TEAM_RED, TEAM_BLUE), P[1], StrToIntDef(P[1], -1)); + begin + if P[2] = 'red' then + t := TEAM_RED + else if P[2] = 'blue' then + t := TEAM_BLUE + else + t := TEAM_NONE; + + if Length(P) = 3 + then g_Bot_AddList(t, P[1], StrToIntDef(P[1], -1)) + else g_Bot_AddList(t, P[1], StrToIntDef(P[1], -1), StrToIntDef(P[3], 100)); + end; end; end else if cmd = 'bot_removeall' then -- 2.29.2