From: terencehill Date: Tue, 22 May 2018 17:40:30 +0000 (+0200) Subject: Bot AI: don't artificially reduce max jump height in real-time; it fixes bots getting... X-Git-Tag: xonotic-v0.8.5~1923^2~51 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=e4d1a13983beb769b736ace7be96fe6143deb83d;p=xonotic%2Fxonotic-data.pk3dir.git 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 --- 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; }