]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add link from waypoint to item when they overlap
authorterencehill <piuntn@gmail.com>
Mon, 11 Sep 2017 16:21:27 +0000 (18:21 +0200)
committerterencehill <piuntn@gmail.com>
Mon, 11 Sep 2017 16:21:27 +0000 (18:21 +0200)
qcsrc/server/bot/default/navigation.qc

index ea54b5571fa16e49c998548c789c18dfb2e4e1ad..61d2d530de10762ff997229d44e3c9a66b701c77 100644 (file)
@@ -773,7 +773,14 @@ entity navigation_findnearestwaypoint_withdist_except(entity ent, float walkfrom
        IL_EACH(g_waypoints, it != ent && it != except,
        {
                if(boxesoverlap(pm1, pm2, it.absmin, it.absmax))
+               {
+                       if(!autocvar_g_waypointeditor && walkfromwp && !ent.navigation_dynamicgoal)
+                       {
+                               waypoint_clearlinks(ent); // initialize wpXXmincost fields
+                               navigation_item_addlink(it, ent);
+                       }
                        return it;
+               }
        });
 
        vector org = ent.origin;