self.bot_strategytime = 0;
}
}
+ else if(self.aistatus & AI_STATUS_STUCK)
+ navigation_unstuck();
// now call the current bot AI (havocbot for example)
self.bot_ai();
self.playermodel_freeme = string_null;
self.playerskin_freeme = string_null;
remove(self.bot_cmd_current);
+ if(bot_waypoint_queue_owner==self)
+ bot_waypoint_queue_owner = world;
}
void bot_clientconnect()
local float besttime;
local entity best, head;
- if(teams_matter)
+ if(teamplay)
{
bot_removefromlargestteam();
return;
head.totalfrags_lastcheck = head.totalfrags;
}
+void bot_calculate_stepheightvec(void)
+{
+ stepheightvec = autocvar_sv_stepheight * '0 0 1';
+ jumpstepheightvec = stepheightvec +
+ ((autocvar_sv_jumpvelocity * autocvar_sv_jumpvelocity) / (2 * autocvar_sv_gravity)) * '0 0 0.85';
+ // 0.75 factor is for safety to make the jumps easy
+}
+
void bot_serverframe()
{
float realplayers, bots, activerealplayers;
if (time < 2)
return;
- stepheightvec = autocvar_sv_stepheight * '0 0 1';
+ bot_calculate_stepheightvec();
bot_navigation_movemode = ((autocvar_bot_navigation_ignoreplayers) ? MOVE_NOMONSTERS : MOVE_NORMAL);
if(time > autoskill_nextthink)
// But don't remove bots immediately on level change, as the real players
// usually haven't rejoined yet
bots_would_leave = FALSE;
- if (teams_matter && autocvar_bot_vs_human && (c3==-1 && c4==-1))
+ if (teamplay && autocvar_bot_vs_human && (c3==-1 && c4==-1))
bots = min(ceil(fabs(autocvar_bot_vs_human) * activerealplayers), maxclients - realplayers);
else if ((realplayers || autocvar_bot_join_empty || (currentbots > 0 && time < 5)))
{
localcmd("quit\n");
}
- if (currentbots > 0 || autocvar_g_waypointeditor)
+ if (currentbots > 0 || autocvar_g_waypointeditor || autocvar_g_waypointeditor_auto)
if (botframe_spawnedwaypoints)
{
if(botframe_cachedwaypointlinks)
if (autocvar_g_waypointeditor)
botframe_showwaypointlinks();
+ if (autocvar_g_waypointeditor_auto)
+ botframe_autowaypoints();
+
if(time > bot_cvar_nextthink)
{
if(currentbots>0)