From 06e8d25c5915b1675dadaf40beb3f65acfbe04b2 Mon Sep 17 00:00:00 2001 From: terencehill Date: Sat, 9 Sep 2017 16:34:29 +0200 Subject: [PATCH] Bot AI: use correct button to activate jetpack, initialize it to false to avoid bots never stop using the jetpack --- qcsrc/server/bot/default/havocbot/havocbot.qc | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/qcsrc/server/bot/default/havocbot/havocbot.qc b/qcsrc/server/bot/default/havocbot/havocbot.qc index 778869f5b..f842c29d3 100644 --- a/qcsrc/server/bot/default/havocbot/havocbot.qc +++ b/qcsrc/server/bot/default/havocbot/havocbot.qc @@ -465,6 +465,7 @@ void havocbot_movetogoal(entity this) CS(this).movement = '0 0 0'; maxspeed = autocvar_sv_maxspeed; + PHYS_INPUT_BUTTON_JETPACK(this) = false; // Jetpack navigation if(this.goalcurrent) if(this.navigation_jetpack_goal) @@ -525,7 +526,7 @@ void havocbot_movetogoal(entity this) } // Flying - PHYS_INPUT_BUTTON_HOOK(this) = true; + PHYS_INPUT_BUTTON_JETPACK(this) = true; if(this.navigation_jetpack_point.z - STAT(PL_MAX, this).z + STAT(PL_MIN, this).z < this.origin.z) { CS(this).movement_x = dir * v_forward * maxspeed; @@ -612,8 +613,7 @@ void havocbot_movetogoal(entity this) this.aistatus &= ~AI_STATUS_OUT_JUMPPAD; // If there is a trigger_hurt right below try to use the jetpack or make a rocketjump - if(skill>6) - if (!(IS_ONGROUND(this))) + if (skill > 6 && !(IS_ONGROUND(this))) { #define ROCKETJUMP_DAMAGE() WEP_CVAR(devastator, damage) * 0.8 \ * ((this.strength_finished < time) ? autocvar_g_balance_powerup_strength_selfdamage : 1) \ @@ -627,12 +627,10 @@ void havocbot_movetogoal(entity this) if(tracebox_hits_trigger_hurt(this.origin, this.mins, this.maxs, trace_endpos + '0 0 1' )) { if(this.velocity.z<0) - { - PHYS_INPUT_BUTTON_HOOK(this) = true; - } + PHYS_INPUT_BUTTON_JETPACK(this) = true; } else - PHYS_INPUT_BUTTON_HOOK(this) = true; + PHYS_INPUT_BUTTON_JETPACK(this) = true; // If there is no goal try to move forward -- 2.39.2