]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix bots sometimes getting stuck in front of certain teleports (e.g. Boil's teleport)
authorterencehill <piuntn@gmail.com>
Mon, 1 May 2017 21:23:22 +0000 (23:23 +0200)
committerterencehill <piuntn@gmail.com>
Mon, 1 May 2017 21:23:22 +0000 (23:23 +0200)
qcsrc/server/bot/default/havocbot/havocbot.qc

index 42f51af8c7f279c3e1e510fd2ff3c1e56dd469d0..dd65b45afa51fa0c60e0495e63d11086f0214eb5 100644 (file)
@@ -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);