]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/warpzonelib/server.qc
Listbox / Picker: Implement item fading in a different way so that it gets influenced...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / warpzonelib / server.qc
index 06af2fdfc87cb8af88eb43cb77b5b73cdb175b86..a9380070b7f7f77d57bca408ad03ba5c648bcc0d 100644 (file)
@@ -1,8 +1,8 @@
 #if defined(CSQC)
 #elif defined(MENUQC)
 #elif defined(SVQC)
-       #include "../dpdefs/progsdefs.qc"
-       #include "../dpdefs/dpextensions.qc"
+       #include "../dpdefs/progsdefs.qh"
+       #include "../dpdefs/dpextensions.qh"
        #include "common.qh"
        #include "server.qh"
        #include "../common/constants.qh"
@@ -51,7 +51,7 @@ void WarpZone_TeleportPlayer(entity teleporter, entity player, vector to, vector
        WarpZone_PostTeleportPlayer_Callback(player);
 }
 
-float WarpZone_Teleported_Send(entity to, float sf)
+bool WarpZone_Teleported_Send(entity to, int sf)
 {
        WriteByte(MSG_ENTITY, ENT_CLIENT_WARPZONE_TELEPORTED);
        WriteCoord(MSG_ENTITY, self.angles.x);
@@ -216,13 +216,12 @@ void WarpZone_Touch (void)
        }
 }
 
-float WarpZone_Send(entity to, float sendflags)
+bool WarpZone_Send(entity to, int sendflags)
 {
-       float f;
        WriteByte(MSG_ENTITY, ENT_CLIENT_WARPZONE);
 
        // we must send this flag for clientside to match properly too
-       f = 0;
+       int f = 0;
        if(self.warpzone_isboxy)
                BITSET_ASSIGN(f, 1);
        if(self.warpzone_fadestart)
@@ -271,9 +270,9 @@ float WarpZone_Send(entity to, float sendflags)
        return true;
 }
 
-float WarpZone_Camera_Send(entity to, float sendflags)
+bool WarpZone_Camera_Send(entity to, int sendflags)
 {
-       float f = 0;
+       int f = 0;
        WriteByte(MSG_ENTITY, ENT_CLIENT_WARPZONE_CAMERA);
 
        if(self.warpzone_fadestart)
@@ -538,7 +537,7 @@ void WarpZone_InitStep_UpdateTransform()
 {
        vector org, ang, norm, point;
        float area;
-       vector tri, a, b, c, p, q, n;
+       vector tri, a, b, c, n;
        float i_s, i_t, n_t;
        string tex;
 
@@ -562,11 +561,7 @@ void WarpZone_InitStep_UpdateTransform()
                        a = getsurfacepoint(self, i_s, tri.x);
                        b = getsurfacepoint(self, i_s, tri.y);
                        c = getsurfacepoint(self, i_s, tri.z);
-                       p = b - a;
-                       q = c - a;
-                       n =     '1 0 0' * (q.y * p.z - q.z * p.y)
-                       +       '0 1 0' * (q.z * p.x - q.x * p.z)
-                       +       '0 0 1' * (q.x * p.y - q.y * p.x);
+                       n = cross(c - a, b - a);
                        area = area + vlen(n);
                        norm = norm + n;
                        point = point + vlen(n) * (a + b + c);
@@ -599,7 +594,7 @@ void WarpZone_InitStep_UpdateTransform()
                                norm = -1 * norm;
                        }
                        ang = vectoangles2(norm, v_up); // keep rotation, but turn exactly against plane
-                       ang_x = -ang.x;
+                       ang.x = -ang.x;
                        if(norm * v_forward < 0.99)
                                print("trigger_warpzone near ", vtos(self.aiment.origin), " has been turned to match plane orientation (", vtos(self.aiment.angles), " -> ", vtos(ang), "\n");
                        if(vlen(org - self.aiment.origin) > 0.5)
@@ -610,7 +605,7 @@ void WarpZone_InitStep_UpdateTransform()
        {
                org = point;
                ang = vectoangles(norm);
-               ang_x = -ang.x;
+               ang.x = -ang.x;
        }
        else
                error("cannot infer origin/angles for this warpzone, please use a killtarget or a trigger_warpzone_position");
@@ -848,7 +843,7 @@ void WarpZone_StartFrame()
                if(IS_NOT_A_CLIENT(e))
                {
                        if(warpzone_warpzones_exist)
-                               for(0; (e = nextent(e)); )
+                               for (; (e = nextent(e)); )
                                        WarpZone_StoreProjectileData(e);
                        break;
                }