]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Bot AI: lock aim when teleported or passing through a warpzone;
authorterencehill <piuntn@gmail.com>
Thu, 6 Dec 2018 00:18:34 +0000 (01:18 +0100)
committerterencehill <piuntn@gmail.com>
Thu, 6 Dec 2018 19:32:07 +0000 (20:32 +0100)
qcsrc/server/bot/default/havocbot/havocbot.qc
qcsrc/server/bot/default/navigation.qc

index d6658a08456c434cfd24b8872c6c5a7646b133f1..b82398675c175290a77594bba4b420fc11362647 100644 (file)
@@ -32,6 +32,9 @@ void havocbot_ai(entity this)
                return;
 
        this.bot_aimdir_executed = false;
+       // lock aim if teleported or passing through a warpzone
+       if (this.lastteleporttime && !this.jumppadcount)
+               this.bot_aimdir_executed = true;
 
        if(bot_execute_commands(this))
                return;
index 5e509506db6d3ba5f5340efa6607fef7d0aa6ba2..7c7f7e1e1264a8e7b9eaeb98be8f7780efd1cd85 100644 (file)
@@ -742,6 +742,7 @@ bool tracewalk(entity e, vector start, vector m1, vector m2, vector end, float e
 // completely empty the goal stack, used when deciding where to go
 void navigation_clearroute(entity this)
 {
+       this.lastteleporttime = 0;
        this.goalcurrent_prev = this.goalcurrent;
        this.goalcurrent_distance_2d = FLOAT_MAX;
        this.goalcurrent_distance_z = FLOAT_MAX;