From: terencehill Date: Mon, 1 May 2017 21:23:22 +0000 (+0200) Subject: Fix bots sometimes getting stuck in front of certain teleports (e.g. Boil's teleport) X-Git-Tag: xonotic-v0.8.5~2378^2~168 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=abf0a68bd55852af3d19338754ac49828dd9c0b1;p=xonotic%2Fxonotic-data.pk3dir.git Fix bots sometimes getting stuck in front of certain teleports (e.g. Boil's teleport) --- diff --git a/qcsrc/server/bot/default/havocbot/havocbot.qc b/qcsrc/server/bot/default/havocbot/havocbot.qc index 42f51af8c..dd65b45af 100644 --- a/qcsrc/server/bot/default/havocbot/havocbot.qc +++ b/qcsrc/server/bot/default/havocbot/havocbot.qc @@ -722,6 +722,12 @@ void havocbot_movetogoal(entity this) destorg.x = bound(m1_x, destorg.x, m2_x); destorg.y = bound(m1_y, destorg.y, m2_y); destorg.z = bound(m1_z, destorg.z, m2_z); + + // in case bot ends up inside the teleport waypoint without touching + // the teleport itself, head to the teleport origin + if(destorg == this.origin) + destorg = this.goalcurrent.origin; + diff = destorg - this.origin; //dist = vlen(diff); dir = normalize(diff);