void bot_clearqueue(entity bot)
{
if(!bot.bot_cmdqueuebuf_allocated)
- error("clearqueue but no queue allocated");
+ return;
buf_del(bot.bot_cmdqueuebuf);
bot.bot_cmdqueuebuf_allocated = FALSE;
dprint("bot ", bot.netname, " queue cleared\n");
FOR_EACH_CLIENT(cl) if(cl.isbot)
{
cl.bot_cmd_execution_index = 0;
- if(cl.bot_cmdqueuebuf_allocated)
- bot_clearqueue(cl);
+ bot_clearqueue(cl);
// also, cancel all barriers
cl.bot_barrier = 0;
for(i = 0; i < cl.bot_places_count; ++i)
bot_resetqueues();
return;
}
+ else if(argv(1) == "setbots")
+ {
+ cvar_settemp("bot_vs_human", "0");
+ cvar_settemp("minplayers", "0");
+ cvar_settemp("bot_number", "0");
+ bot_fixcount();
+ cvar_settemp("bot_number", argv(2));
+ if(!bot_fixcount())
+ print("Sorry, could not set requested bot count\n");
+ return;
+ }
else if(argv(1) == "load" && argc == 3)
{
float fh, i;
}
else if(argv(2) == "setbots")
{
+ cvar_settemp("bot_vs_human", "0");
cvar_settemp("minplayers", "0");
+ cvar_settemp("bot_number", "0");
+ bot_fixcount();
cvar_settemp("bot_number", argv(3));
if(!bot_fixcount())
print("Sorry, could not set requested bot count\n");