]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Bot waypoints: spawn only one destination waypoint for teleports teleporting player...
authorterencehill <piuntn@gmail.com>
Thu, 3 May 2018 09:00:18 +0000 (11:00 +0200)
committerterencehill <piuntn@gmail.com>
Thu, 3 May 2018 09:00:18 +0000 (11:00 +0200)
qcsrc/server/bot/default/waypoints.qc

index 384f1e7ce1c87ddebc1d048a8838d69181f051a6..ce7c69305e2e7a85fc93fbfdeaf21a42af9247cf 100644 (file)
@@ -190,6 +190,16 @@ entity waypoint_spawn(vector m1, vector m2, float f)
                        return it;
                });
        }
+       // spawn only one destination waypoint for teleports teleporting player to the exact same spot
+       // otherwise links loaded from file would be applied only to the first destination
+       // waypoint since link format doesn't specify waypoint entities but just positions
+       if((f & WAYPOINTFLAG_GENERATED) && !(f & WAYPOINTFLAG_NORELINK) && m1 == m2)
+       {
+               IL_EACH(g_waypoints, boxesoverlap(m1, m2, it.absmin, it.absmax),
+               {
+                       return it;
+               });
+       }
 
        entity w = new(waypoint);
        IL_PUSH(g_waypoints, w);