]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/lib/warpzone/common.qc
Merge branch 'master' into DefaultUser/func_button_relay
[xonotic/xonotic-data.pk3dir.git] / qcsrc / lib / warpzone / common.qc
index 78d51cf0bc4fa4c6f050b6c137978eb130695d16..82d3a50719356083ae96fbb18d691dfc2b9f83df 100644 (file)
@@ -575,12 +575,9 @@ bool WarpZoneLib_BadEntity(entity e)
 {
        if (is_pure(e)) return true;
        string s = e.classname;
-       switch (s)
-       {
-               // case "net_linked": // actually some real entities are linked without classname, fail
-               case "":
-                       return true;
-       }
+
+       //if (s == "net_linked") return true; // actually some real entities are linked without classname, fail
+       if (s == "") return true;
 
        if (startsWith(s, "target_")) return true;
 
@@ -787,7 +784,7 @@ entity WarpZone_RefSys_SpawnSameRefSys(entity me)
        return e;
 }
 
-float WarpZoneLib_ExactTrigger_Touch(entity this, entity toucher)
+bool WarpZoneLib_ExactTrigger_Touch(entity this, entity toucher)
 {
        return !WarpZoneLib_BoxTouchesBrush(toucher.absmin, toucher.absmax, this, toucher);
 }
@@ -807,11 +804,9 @@ void WarpZoneLib_MoveOutOfSolid_Expand(entity e, vector by)
        }
 }
 
-float WarpZoneLib_MoveOutOfSolid(entity e)
+bool WarpZoneLib_MoveOutOfSolid(entity e)
 {
-       vector o, m0, m1;
-
-       o = e.origin;
+       vector o = e.origin;
        traceline(o, o, MOVE_WORLDONLY, e);
        if (trace_startsolid)
                return false;
@@ -820,22 +815,16 @@ float WarpZoneLib_MoveOutOfSolid(entity e)
        if (!trace_startsolid)
                return true;
 
-       m0 = e.mins;
-       m1 = e.maxs;
+       vector m0 = e.mins;
+       vector m1 = e.maxs;
        e.mins = '0 0 0';
        e.maxs = '0 0 0';
-       WarpZoneLib_MoveOutOfSolid_Expand(e, '1 0 0' * m0_x);
-       e.mins_x = m0_x;
-       WarpZoneLib_MoveOutOfSolid_Expand(e, '1 0 0' * m1_x);
-       e.maxs_x = m1_x;
-       WarpZoneLib_MoveOutOfSolid_Expand(e, '0 1 0' * m0_y);
-       e.mins_y = m0_y;
-       WarpZoneLib_MoveOutOfSolid_Expand(e, '0 1 0' * m1_y);
-       e.maxs_y = m1_y;
-       WarpZoneLib_MoveOutOfSolid_Expand(e, '0 0 1' * m0_z);
-       e.mins_z = m0_z;
-       WarpZoneLib_MoveOutOfSolid_Expand(e, '0 0 1' * m1_z);
-       e.maxs_z = m1_z;
+       WarpZoneLib_MoveOutOfSolid_Expand(e, eX * m0.x); e.mins_x = m0.x;
+       WarpZoneLib_MoveOutOfSolid_Expand(e, eX * m1.x); e.maxs_x = m1.x;
+       WarpZoneLib_MoveOutOfSolid_Expand(e, eY * m0.y); e.mins_y = m0.y;
+       WarpZoneLib_MoveOutOfSolid_Expand(e, eY * m1.y); e.maxs_y = m1.y;
+       WarpZoneLib_MoveOutOfSolid_Expand(e, eZ * m0.z); e.mins_z = m0.z;
+       WarpZoneLib_MoveOutOfSolid_Expand(e, eZ * m1.z); e.maxs_z = m1.z;
        setorigin(e, e.origin);
 
        tracebox(e.origin, e.mins, e.maxs, e.origin, MOVE_WORLDONLY, e);