]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/warpzonelib/common.qc
new physics config by Lee Stricklin; fix electro beam through warpzones when standing...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / warpzonelib / common.qc
index d9af61894f5a515be2a5d1932e8bc62146018d68..8536bd3d2c464bf575b32356ce60599432cd6190 100644 (file)
@@ -132,6 +132,8 @@ 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 world;
        for(e = world; (e = find(e, classname, "trigger_warpzone")); )
                if(WarpZoneLib_BoxTouchesBrush(mi, ma, e, world))
                        return e;
@@ -141,6 +143,8 @@ entity WarpZone_Find(vector mi, vector ma)
 void WarpZone_MakeAllSolid()
 {
        entity e;
+       if(!warpzone_warpzones_exist)
+               return;
        for(e = world; (e = find(e, classname, "trigger_warpzone")); )
                e.solid = SOLID_BSP;
 }
@@ -148,6 +152,8 @@ void WarpZone_MakeAllSolid()
 void WarpZone_MakeAllOther()
 {
        entity e;
+       if(!warpzone_warpzones_exist)
+               return;
        for(e = world; (e = find(e, classname, "trigger_warpzone")); )
                e.solid = SOLID_TRIGGER;
 }
@@ -227,7 +233,7 @@ void WarpZone_TraceBox_ThroughZone(vector org, vector mi, vector ma, vector end,
                        goto fail;
                }
                WarpZone_Trace_AddTransform(wz);
-               org = WarpZone_TransformOrigin(wz, trace_endpos);
+               org = WarpZone_TransformOrigin(wz, org);
                end = WarpZone_TransformOrigin(wz, end);
        }
        WarpZone_MakeAllSolid();