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 d6658a0..b823986 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 5e50950..7c7f7e1 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;