]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/bot/default/waypoints.qc
Kill some more vlen uses
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / bot / default / waypoints.qc
index 84995d1c7d5613b1b9f925dc8bba4aca769394c4..5fb923799acfa41f863414a7ed96d33253874acd 100644 (file)
@@ -34,7 +34,7 @@ entity waypoint_spawn(vector m1, vector m2, float f)
        w.solid = SOLID_TRIGGER;
        setorigin(w, (m1 + m2) * 0.5);
        setsize(w, m1 - w.origin, m2 - w.origin);
-       if (vlen(w.size) > 0)
+       if (w.size)
                w.wpisbox = true;
 
        if(!w.wpisbox)
@@ -44,7 +44,7 @@ entity waypoint_spawn(vector m1, vector m2, float f)
                {
                        if(!(f & WAYPOINTFLAG_GENERATED))
                        {
-                               LOG_TRACE("Killed a waypoint that was stuck in solid at ", vtos(w.origin), "\n");
+                               LOG_TRACE("Killed a waypoint that was stuck in solid at ", vtos(w.origin));
                                delete(w);
                                return NULL;
                        }
@@ -280,7 +280,7 @@ void waypoint_schedulerelink(entity wp)
        }
        else
                wp.model = "";
-       wp.wpisbox = vlen(wp.size) > 0;
+       wp.wpisbox = vdist(wp.size, >, 0);
        wp.enemy = NULL;
        if (!(wp.wpflags & WAYPOINTFLAG_PERSONAL))
                wp.owner = NULL;
@@ -378,7 +378,7 @@ float waypoint_load_links()
        {
                LOG_TRACE("waypoint links load from ");
                LOG_TRACE(filename);
-               LOG_TRACE(" failed\n");
+               LOG_TRACE(" failed");
                return false;
        }
 
@@ -414,7 +414,7 @@ float waypoint_load_links()
 
                        if(!found)
                        {
-                               LOG_TRACE("waypoint_load_links: couldn't find 'from' waypoint at ", vtos(wp_from.origin),"\n");
+                               LOG_TRACE("waypoint_load_links: couldn't find 'from' waypoint at ", vtos(wp_from.origin));
                                continue;
                        }
 
@@ -436,7 +436,7 @@ float waypoint_load_links()
 
                if(!found)
                {
-                       LOG_TRACE("waypoint_load_links: couldn't find 'to' waypoint at ", vtos(wp_to.origin),"\n");
+                       LOG_TRACE("waypoint_load_links: couldn't find 'to' waypoint at ", vtos(wp_to.origin));
                        continue;
                }
 
@@ -446,7 +446,7 @@ float waypoint_load_links()
 
        fclose(file);
 
-       LOG_TRACE("loaded ", ftos(c), " waypoint links from maps/", mapname, ".waypoints.cache\n");
+       LOG_TRACE("loaded ", ftos(c), " waypoint links from maps/", mapname, ".waypoints.cache");
 
        botframe_cachedwaypointlinks = true;
        return true;
@@ -466,7 +466,7 @@ void waypoint_load_links_hardwired()
 
        if (file < 0)
        {
-               LOG_TRACE("waypoint links load from ", filename, " failed\n");
+               LOG_TRACE("waypoint links load from ", filename, " failed");
                return;
        }
 
@@ -537,7 +537,7 @@ void waypoint_load_links_hardwired()
 
        fclose(file);
 
-       LOG_TRACE("loaded ", ftos(c), " waypoint links from maps/", mapname, ".waypoints.hardwired\n");
+       LOG_TRACE("loaded ", ftos(c), " waypoint links from maps/", mapname, ".waypoints.hardwired");
 }
 
 entity waypoint_get_link(entity w, float i)
@@ -681,11 +681,11 @@ float waypoint_loadall()
                                cwb = cwb + 1;
                }
                fclose(file);
-               LOG_TRACE("loaded ", ftos(cwp), " waypoints and ", ftos(cwb), " wayboxes from maps/", mapname, ".waypoints\n");
+               LOG_TRACE("loaded ", ftos(cwp), " waypoints and ", ftos(cwb), " wayboxes from maps/", mapname, ".waypoints");
        }
        else
        {
-               LOG_TRACE("waypoint load from ", filename, " failed\n");
+               LOG_TRACE("waypoint load from ", filename, " failed");
        }
        return cwp + cwb;
 }
@@ -1012,7 +1012,7 @@ void botframe_autowaypoints_fix(entity p, float walkfromwp, .entity fld)
 
 void botframe_deleteuselesswaypoints()
 {
-       FOREACH_ENTITY_FLOAT(bot_pickup, true,
+       IL_EACH(g_items, it.bot_pickup,
        {
                // NOTE: this protects waypoints if they're the ONLY nearest
                // waypoint. That's the intention.