]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Bot AI: also try to make a medium jump in real-time; it fixes bots getting stuck...
authorterencehill <piuntn@gmail.com>
Tue, 22 May 2018 17:57:50 +0000 (19:57 +0200)
committerterencehill <piuntn@gmail.com>
Tue, 22 May 2018 17:57:50 +0000 (19:57 +0200)
qcsrc/server/bot/default/havocbot/havocbot.qc

index 9c3ac1cd324101010f34deaa8a139830c4b2384d..a0b1e398d283014d94f8501af2b32b511f3b775f 100644 (file)
@@ -986,6 +986,13 @@ void havocbot_movetogoal(entity this)
                                        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;
+                                       else
+                                       {
+                                               jump_height = stepheightvec + jumpheight_vec / 2;
+                                               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;
+                                       }
                                }
                        }