]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Improve loose goal touching check when not running (useful to dumb bots like Lion)
authorterencehill <piuntn@gmail.com>
Fri, 17 Feb 2017 01:17:32 +0000 (02:17 +0100)
committerterencehill <piuntn@gmail.com>
Fri, 17 Feb 2017 01:17:32 +0000 (02:17 +0100)
qcsrc/server/bot/default/navigation.qc

index 0883bacd02725bd72faed7c6af2702ee5e742a8b..2cfc6d33a83189009a866fbd8e7a690636e7eab4 100644 (file)
@@ -985,8 +985,18 @@ void navigation_poptouchedgoals(entity this)
                }
        }
 
-       while (this.goalcurrent && !IS_PLAYER(this.goalcurrent) && boxesoverlap(m1, m2, this.goalcurrent.absmin, this.goalcurrent.absmax))
+       while (this.goalcurrent && !IS_PLAYER(this.goalcurrent))
        {
+               vector gc_min = this.goalcurrent.absmin;
+               vector gc_max = this.goalcurrent.absmax;
+               if(this.goalcurrent.classname == "waypoint")
+               {
+                       gc_min = this.goalcurrent.origin - '1 1 1' * 12;
+                       gc_max = this.goalcurrent.origin + '1 1 1' * 12;
+               }
+               if(!boxesoverlap(m1, m2, gc_min, gc_max))
+                       break;
+
                if((this.goalcurrent.wpflags & WAYPOINTFLAG_TELEPORT))
                        break;