]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/bot/havocbot/havocbot.qc
Clean up some for() loops, also replace a few remaining cases of VHF_ISVEHICLE with...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / bot / havocbot / havocbot.qc
index f6c0348d28065517ff5865f0a5a21e8a3f27704a..c3603e9ff1bdc7390bde112b1e67d876d4fd0921 100644 (file)
@@ -1233,15 +1233,11 @@ float havocbot_moveto(entity this, vector pos)
        this.aistatus |= AI_STATUS_WAYPOINT_PERSONAL_LINKING;
 
        // if pos is inside a teleport, then let's mark it as teleport waypoint
-       entity head;
-       for(head = NULL; (head = find(head, classname, "trigger_teleport")); )
+       FOREACH_ENTITY_CLASS("trigger_teleport", WarpZoneLib_BoxTouchesBrush(pos, pos, it, NULL),
        {
-               if(WarpZoneLib_BoxTouchesBrush(pos, pos, head, NULL))
-               {
-                       wp.wpflags |= WAYPOINTFLAG_TELEPORT;
-                       this.lastteleporttime = 0;
-               }
-       }
+               wp.wpflags |= WAYPOINTFLAG_TELEPORT;
+               this.lastteleporttime = 0;
+       });
 
 /*
        if(wp.wpflags & WAYPOINTFLAG_TELEPORT)