From: terencehill Date: Thu, 6 Dec 2018 00:18:34 +0000 (+0100) Subject: Bot AI: lock aim when teleported or passing through a warpzone; X-Git-Tag: xonotic-v0.8.5~1705^2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=38a6a16f6923cd12c1284afe10c030845f4b8234;p=xonotic%2Fxonotic-data.pk3dir.git Bot AI: lock aim when teleported or passing through a warpzone; --- 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;