From 73619c8944d3467b3678091eac21fcd56c1806f9 Mon Sep 17 00:00:00 2001 From: mand1nga Date: Thu, 18 Aug 2011 18:43:33 -0300 Subject: [PATCH] Do not try to BH while having enemies on sight (until backwards BH gets correctly implemented). Automatically remove from the stack any goal leading to dangerous path --- qcsrc/server/bot/havocbot/havocbot.qc | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/qcsrc/server/bot/havocbot/havocbot.qc b/qcsrc/server/bot/havocbot/havocbot.qc index 113d31850..2505888ef 100644 --- a/qcsrc/server/bot/havocbot/havocbot.qc +++ b/qcsrc/server/bot/havocbot/havocbot.qc @@ -260,15 +260,12 @@ void havocbot_bunnyhop(vector dir) if(autocvar_g_midair) return; - // Don't jump when using some weapons - /* + // Don't jump when attacking if(self.aistatus & AI_STATUS_ATTACKING) - if(self.weapon == WEP_RIFLE) return; if(self.goalcurrent.classname == "player") return; - */ maxspeed = autocvar_sv_maxspeed; @@ -789,12 +786,11 @@ void havocbot_movetogoal() if(tracebox_hits_trigger_hurt(dst_ahead, self.mins, self.maxs, trace_endpos)) { // Remove dangerous dynamic goals from stack - if (self.goalcurrent.classname == "player" || self.goalcurrent.classname == "droppedweapon") - { - navigation_poproute(); - if(self.goalcurrent) - gco = (self.goalcurrent.absmin + self.goalcurrent.absmax) * 0.5; - } + dprint("bot ", self.netname, " removed the goal ", self.goalcurrent.classname, " ", etos(self.goalcurrent), " because it leads to a dangerous path\n"); + navigation_poproute(); + if(self.goalcurrent) + gco = (self.goalcurrent.absmin + self.goalcurrent.absmax) * 0.5; + // try to stop flatdir = '0 0 0'; evadeobstacle = normalize(self.velocity) * -1; -- 2.39.2