From e4d1a13983beb769b736ace7be96fe6143deb83d Mon Sep 17 00:00:00 2001 From: terencehill Date: Tue, 22 May 2018 19:40:30 +0200 Subject: [PATCH] Bot AI: don't artificially reduce max jump height in real-time; it fixes bots getting stuck in rare cases in front of tall objects that it can actually jump --- qcsrc/server/bot/default/havocbot/havocbot.qc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/qcsrc/server/bot/default/havocbot/havocbot.qc b/qcsrc/server/bot/default/havocbot/havocbot.qc index b5888c0b9..9c3ac1cd3 100644 --- a/qcsrc/server/bot/default/havocbot/havocbot.qc +++ b/qcsrc/server/bot/default/havocbot/havocbot.qc @@ -980,7 +980,10 @@ void havocbot_movetogoal(entity this) if (trace_plane_normal.z < 0.7) { s = trace_fraction; - tracebox(this.origin + jumpstepheightvec, this.mins, this.maxs, actual_destorg + jumpstepheightvec, false, this); + // don't artificially reduce max jump height in real-time + // (jumpstepheightvec is reduced a bit to make the jumps easy in tracewalk) + vector jump_height = (IS_ONGROUND(this)) ? stepheightvec + jumpheight_vec : jumpstepheightvec; + tracebox(this.origin + jump_height, this.mins, this.maxs, actual_destorg + jump_height, false, this); if (trace_fraction > s) PHYS_INPUT_BUTTON_JUMP(this) = true; } -- 2.39.2