]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Bot AI: fix low skilled bots deviating too much from waypoint path due to movement...
authorterencehill <piuntn@gmail.com>
Tue, 25 Dec 2018 18:36:28 +0000 (19:36 +0100)
committerterencehill <piuntn@gmail.com>
Tue, 25 Dec 2018 18:42:56 +0000 (19:42 +0100)
qcsrc/server/bot/default/havocbot/havocbot.qc

index d2bb62ca38d389b1e5dcb79817e8e6c68b06993f..bc396fd7298a2bd29974b60f0fd2a99b5127f81e 100644 (file)
@@ -255,12 +255,12 @@ void havocbot_keyboard_movement(entity this, vector destorg)
                this.havocbot_keyboard = keyboard * autocvar_sv_maxspeed;
                if (this.havocbot_ducktime > time)
                        PHYS_INPUT_BUTTON_CROUCH(this) = true;
-       }
 
-       keyboard = this.havocbot_keyboard;
-       float blend = bound(0, vlen(destorg - this.origin) / autocvar_bot_ai_keyboard_distance, 1); // When getting close move with 360 degree
-       //dprint("movement ", vtos(CS(this).movement), " keyboard ", vtos(keyboard), " blend ", ftos(blend), "\n");
-       CS(this).movement = CS(this).movement + (keyboard - CS(this).movement) * blend;
+               keyboard = this.havocbot_keyboard;
+               float blend = bound(0, vlen(destorg - this.origin) / autocvar_bot_ai_keyboard_distance, 1); // When getting close move with 360 degree
+               //dprint("movement ", vtos(CS(this).movement), " keyboard ", vtos(keyboard), " blend ", ftos(blend), "\n");
+               CS(this).movement = CS(this).movement + (keyboard - CS(this).movement) * blend;
+       }
 }
 
 void havocbot_bunnyhop(entity this, vector dir)