// 0.75 factor is for safety to make the jumps easy
}
-void bot_serverframe()
+float bot_fixcount()
{
- float realplayers, bots, activerealplayers;
entity head;
-
- if (intermission_running)
- return;
-
- if (time < 2)
- return;
-
- bot_calculate_stepheightvec();
- bot_navigation_movemode = ((autocvar_bot_navigation_ignoreplayers) ? MOVE_NOMONSTERS : MOVE_NORMAL);
-
- if(time > autoskill_nextthink)
- {
- float a;
- a = autocvar_skill_auto;
- if(a)
- autoskill(a);
- autoskill_nextthink = time + 5;
- }
+ float realplayers, bots, activerealplayers;
activerealplayers = 0;
realplayers = 0;
bots = 0;
}
- bot_ignore_bots = autocvar_bot_ignore_bots;
-
// only add one bot per frame to avoid utter chaos
if(time > botframe_nextthink)
{
if (bot_spawn() == world)
{
bprint("Can not add bot, server full.\n");
- botframe_nextthink = time + 10;
- break;
+ return FALSE;
}
}
while (currentbots > bots)
bot_removenewest();
}
+ return TRUE;
+}
+
+void bot_serverframe()
+{
+ if (intermission_running)
+ return;
+
+ if (time < 2)
+ return;
+
+ bot_calculate_stepheightvec();
+ bot_navigation_movemode = ((autocvar_bot_navigation_ignoreplayers) ? MOVE_NOMONSTERS : MOVE_NORMAL);
+
+ if(time > autoskill_nextthink)
+ {
+ float a;
+ a = autocvar_skill_auto;
+ if(a)
+ autoskill(a);
+ autoskill_nextthink = time + 5;
+ }
+
+ if(time > botframe_nextthink)
+ {
+ if(!bot_fixcount())
+ botframe_nextthink = time + 10;
+ }
+
+ bot_ignore_bots = autocvar_bot_ignore_bots;
+
if(botframe_spawnedwaypoints)
{
if(autocvar_waypoint_benchmark)
return;
}
+ // set bot count
+ if(argv(1) == "setbots")
+ {
+ if(argc >= 3 && argv(1) == "setbots")
+ {
+ cvar_settemp("minplayers", "0");
+ cvar_settemp("bot_number", argv(2));
+ bot_fixcount();
+ }
+ }
+
// Load cmds from file
if(argv(1) == "load" && argc == 3)
{
if(argc >= 3 && argv(0) == "sv_cmd" && argv(1) == "bot_cmd")
{
- // let's start at token 2 so we can skip sv_cmd bot_cmd
- bot = find_bot_by_number(stof(argv(2)));
- if(bot == world)
- bot = find_bot_by_name(argv(2));
- if(bot)
- bot_queuecommand(bot, strcat(argv(3), " ", argv(4)));
+ if(argv(2) == "reset")
+ {
+ bot_resetqueues();
+ }
+ else if(argv(2) == "setbots")
+ {
+ cvar_settemp("minplayers", "0");
+ cvar_settemp("bot_number", argv(3));
+ if(!bot_fixcount())
+ print("Sorry, could not set requested bot count\n");
+ }
+ else
+ {
+ // let's start at token 2 so we can skip sv_cmd bot_cmd
+ bot = find_bot_by_number(stof(argv(2)));
+ if(bot == world)
+ bot = find_bot_by_name(argv(2));
+ if(bot)
+ bot_queuecommand(bot, strcat(argv(3), " ", argv(4)));
+ }
}
else
localcmd(strcat(s, "\n"));
void W_Shotgun_Attack2 (void)
{
- sound (self, CH_SHOTS, "weapons/shotgun_melee.wav", VOL_BASE, ATTN_NORM);
+ sound (self, CH_WEAPON_A, "weapons/shotgun_melee.wav", VOL_BASE, ATTN_NORM);
weapon_thinkf(WFRAME_FIRE2, autocvar_g_balance_shotgun_secondary_animtime, w_ready);
entity meleetemp;