]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/lib/warpzone/common.qc
Allow multiple traces through the same warpzone, let the recursive warpzone lightshow...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / lib / warpzone / common.qc
index cff5be75890ec42062ed7f95db63500d54c91e2a..78d51cf0bc4fa4c6f050b6c137978eb130695d16 100644 (file)
@@ -4,7 +4,7 @@
     #include <common/t_items.qh>
 #elif defined(MENUQC)
 #elif defined(SVQC)
-    #include <common/weapons/all.qh>
+    #include <common/weapons/_all.qh>
 #endif
 
 void WarpZone_Accumulator_Clear(entity acc)
@@ -154,31 +154,33 @@ float WarpZoneLib_BoxTouchesBrush(vector mi, vector ma, entity e, entity ig)
 entity WarpZone_Find(vector mi, vector ma)
 {
        // if we are near any warpzone planes - MOVE AWAY (work around nearclip)
-       entity e;
        if(!warpzone_warpzones_exist)
                return NULL;
-       for(e = NULL; (e = find(e, classname, "trigger_warpzone")); )
-               if(WarpZoneLib_BoxTouchesBrush(mi, ma, e, NULL))
-                       return e;
+       IL_EACH(g_warpzones, WarpZoneLib_BoxTouchesBrush(mi, ma, it, NULL),
+       {
+               return it;
+       });
        return NULL;
 }
 
 void WarpZone_MakeAllSolid()
 {
-       entity e;
        if(!warpzone_warpzones_exist)
                return;
-       for(e = NULL; (e = find(e, classname, "trigger_warpzone")); )
-               e.solid = SOLID_BSP;
+       IL_EACH(g_warpzones, true,
+       {
+               it.solid = SOLID_BSP;
+       });
 }
 
 void WarpZone_MakeAllOther()
 {
-       entity e;
        if(!warpzone_warpzones_exist)
                return;
-       for(e = NULL; (e = find(e, classname, "trigger_warpzone")); )
-               e.solid = SOLID_TRIGGER;
+       IL_EACH(g_warpzones, true,
+       {
+               it.solid = SOLID_TRIGGER;
+       });
 }
 
 void WarpZone_Trace_InitTransform()
@@ -296,13 +298,13 @@ void WarpZone_TraceBox_ThroughZone(vector org, vector mi, vector ma, vector end,
                        }
                        break;
                }
-               if(trace_ent == wz)
+               /*if(trace_ent == wz)
                {
                        // FIXME can this check be removed? Do we really need it?
                        LOG_TRACE("I transformed into the same zone again, wtf, aborting the trace");
                        trace_ent = NULL;
                        break;
-               }
+               }*/
                wz = trace_ent;
                if(!WarpZone_trace_firstzone)
                        WarpZone_trace_firstzone = wz;