]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/triggers/teleporters.qc
Undefine BADPRESUFFIX too
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / triggers / teleporters.qc
index a1a38d39e1a95e24459d2a2c4c1a5bb857c7de27..949f478fdd3c714e9ba3402416be4b182c348b7a 100644 (file)
@@ -92,7 +92,7 @@ void TeleportPlayer(entity teleporter, entity player, vector to, vector to_angle
                                        RandomSelection_Init();
                                        FOREACH_WORD(teleporter.noise, true,
                                        {
-                                               RandomSelection_Add(NULL, 0, it, 1, 1);
+                                               RandomSelection_AddString(it, 1, 1);
                                        });
                                        thesound = RandomSelection_chosen_string;
                                }
@@ -198,7 +198,7 @@ entity Simple_TeleportPlayer(entity teleporter, entity player)
                                if(check_tdeath(player, locout, '0 0 0', '0 0 0'))
                                        p = 0;
                        }
-                       RandomSelection_Add(it, 0, string_null, (it.cnt ? it.cnt : 1), p);
+                       RandomSelection_AddEnt(it, (it.cnt ? it.cnt : 1), p);
                });
                e = RandomSelection_chosen_ent;
        }
@@ -267,10 +267,10 @@ void teleport_findtarget(entity this)
 
 entity Teleport_Find(vector mi, vector ma)
 {
-       entity e;
-       for(e = NULL; (e = find(e, classname, "trigger_teleport")); )
-               if(WarpZoneLib_BoxTouchesBrush(mi, ma, e, NULL))
-                       return e;
+       IL_EACH(g_teleporters, WarpZoneLib_BoxTouchesBrush(mi, ma, it, NULL),
+       {
+               return it;
+       });
        return NULL;
 }