]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Bot AI: don't artificially reduce max jump height in real-time; it fixes bots getting...
authorterencehill <piuntn@gmail.com>
Tue, 22 May 2018 17:40:30 +0000 (19:40 +0200)
committerterencehill <piuntn@gmail.com>
Tue, 22 May 2018 17:53:08 +0000 (19:53 +0200)
qcsrc/server/bot/default/havocbot/havocbot.qc

index b5888c0b9f770579b287a1e2b47b05a10277a141..9c3ac1cd324101010f34deaa8a139830c4b2384d 100644 (file)
@@ -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;
                                }