This commit fixes bug related to bot mode, when it is started from non-bot mode.

To see this bug just start AC, run bot team mode and watch:
- "enemies" menu instead of  "team enemies" menu,
- number of players less by 2 than should be.
This commit is contained in:
aurhat
2014-02-12 21:19:55 +01:00
parent b33b74c11c
commit b672cea505
+10 -11
View File
@@ -17,12 +17,11 @@ tmp_botskill = good
tmp_numbots = 1
tmp_mode =
tmp_botmap =
const isbotteammode [ return (&& (curmodeattr bot) (curmodeattr team)) ]
tmp_isbotteammode = 0
// add bots
const startbotmatch [
if (isbotteammode) [ // team botmode
if ($tmp_isbotteammode) [ // team botmode
numrvsf = (div $tmp_numbots 2)
numcla = (div $tmp_numbots 2)
if (= (player1 team) 0) [ -- numcla ] [
@@ -75,19 +74,19 @@ const emptymap [
newmenu singleplayer
// teamplay not mature yet
menuitem (_ [Bot Team Deathmatch]) [ tmp_mode = 7; showmenu botskill ]
menuitem (_ [Bot Deathmatch]) [ tmp_mode = 8; showmenu botskill ]
menuitem (_ [Bot One Shot, One Kill]) [ tmp_mode = 12; showmenu botskill ]
menuitem (_ [Bot Pistol Frenzy]) [ tmp_mode = 18; showmenu botskill ]
menuitem (_ [Bot Last Swiss Standing]) [ tmp_mode = 19; showmenu botskill ]
menuitem (_ [Bot Team Survivor]) [ tmp_mode = 20; showmenu botskill ]
menuitem (_ [Bot Team One Shot, One Kill]) [ tmp_mode = 21; showmenu botskill ]
menuitem (_ [Bot Team Deathmatch]) [ tmp_mode = 7; tmp_isbotteammode = 1; showmenu botskill ]
menuitem (_ [Bot Deathmatch]) [ tmp_mode = 8; tmp_isbotteammode = 0; showmenu botskill ]
menuitem (_ [Bot One Shot, One Kill]) [ tmp_mode = 12; tmp_isbotteammode = 0; showmenu botskill ]
menuitem (_ [Bot Pistol Frenzy]) [ tmp_mode = 18; tmp_isbotteammode = 0; showmenu botskill ]
menuitem (_ [Bot Last Swiss Standing]) [ tmp_mode = 19; tmp_isbotteammode = 0; showmenu botskill ]
menuitem (_ [Bot Team Survivor]) [ tmp_mode = 20; tmp_isbotteammode = 1; showmenu botskill ]
menuitem (_ [Bot Team One Shot, One Kill]) [ tmp_mode = 21; tmp_isbotteammode = 1; showmenu botskill ]
menuitem (_ [Bot Survival]) [ showmenu [Survival Mode] ]
menuitem [] -1
menuitem (_ [Bot settings...]) [ showmenu [Bot settings] ]
menuitem (_ [Empty Map]) emptymap
const showmenu_enemies [ if (isbotteammode $tmp_mode) [ showmenu [team enemies] ] [ showmenu enemies ] ]
const showmenu_enemies [ if ($tmp_isbotteammode) [ showmenu [team enemies] ] [ showmenu enemies ] ]
newmenu botskill