]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix a warning on map load
authorMario <mario@smbclan.net>
Thu, 23 Jun 2016 17:28:11 +0000 (03:28 +1000)
committerMario <mario@smbclan.net>
Thu, 23 Jun 2016 17:28:11 +0000 (03:28 +1000)
qcsrc/server/bot/waypoints.qc

index 6f45ef6c864c903f60c3c7663f60753b4c214170..58bb0b46ba5d5419bf40767b212f93cdda63b22d 100644 (file)
@@ -19,11 +19,12 @@ entity waypoint_spawn(vector m1, vector m2, float f)
 {
        if(!(f & WAYPOINTFLAG_PERSONAL))
        {
-               FOREACH_ENTITY_CLASS("waypoint", boxesoverlap(m1, m2, it.absmin, it.absmax),
+               for(entity wp = findchain(classname, "waypoint"); wp; wp = wp.chain)
                {
                        // if a matching spawnfunc_waypoint already exists, don't add a duplicate
-                       return it;
-               });
+                       if(boxesoverlap(m1, m2, wp.absmin, wp.absmax))
+                               return wp;
+               }
        }