X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fbot%2Fbot.qc;h=351625bb555cef6c001bd02508161691158a9051;hb=4337dab09bbbe024bcc77db446ed76962fb17f0d;hp=581e3f0c758050dae69b33c9c983a98a4ba735c4;hpb=1eadc66440474af5c3d2b2f7e5a24935da3ffbdf;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/bot/bot.qc b/qcsrc/server/bot/bot.qc index 581e3f0c7..351625bb5 100644 --- a/qcsrc/server/bot/bot.qc +++ b/qcsrc/server/bot/bot.qc @@ -98,6 +98,8 @@ void bot_think() 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(); @@ -374,6 +376,8 @@ void bot_clientdisconnect() 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() @@ -449,7 +453,7 @@ void bot_removenewest() local float besttime; local entity best, head; - if(teams_matter) + if(teamplay) { bot_removefromlargestteam(); return; @@ -525,6 +529,14 @@ void autoskill(float factor) 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; @@ -536,7 +548,7 @@ void bot_serverframe() 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) @@ -563,7 +575,7 @@ void bot_serverframe() // 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))) {