* example where cvar_set doesn't work: start Xonotic, set bot_number to 0, start a campaign level, start an Instant Action game: bot_number is set to 0
* example where cvar_set works: start an Instant Action game twice, start a campaign level, start an Instant Action game: bot_number is correctly set
pmin = pstep * ceil(pmin / pstep);
pmax = pstep * floor(pmax / pstep);
p = pmin + pstep * floor(random() * ((pmax - pmin) / pstep + 1));
- cvar_set("bot_number", ftos(p - 1));
+
+ // cvar_set doesn't always work starting an InstantAction game while playing the campaign
+ //cvar_set("bot_number", ftos(p - 1));
+ localcmd(strcat("bot_number ", ftos(p - 1), "\n"));
// make sure we go back to menu
cvar_set("lastlevel", "1");