From 38a6a16f6923cd12c1284afe10c030845f4b8234 Mon Sep 17 00:00:00 2001 From: terencehill Date: Thu, 6 Dec 2018 01:18:34 +0100 Subject: [PATCH] Bot AI: lock aim when teleported or passing through a warpzone; --- qcsrc/server/bot/default/havocbot/havocbot.qc | 3 +++ qcsrc/server/bot/default/navigation.qc | 1 + 2 files changed, 4 insertions(+) diff --git a/qcsrc/server/bot/default/havocbot/havocbot.qc b/qcsrc/server/bot/default/havocbot/havocbot.qc index d6658a084..b82398675 100644 --- a/qcsrc/server/bot/default/havocbot/havocbot.qc +++ b/qcsrc/server/bot/default/havocbot/havocbot.qc @@ -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; diff --git a/qcsrc/server/bot/default/navigation.qc b/qcsrc/server/bot/default/navigation.qc index 5e509506d..7c7f7e1e1 100644 --- a/qcsrc/server/bot/default/navigation.qc +++ b/qcsrc/server/bot/default/navigation.qc @@ -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; -- 2.39.2