]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/t_teleporters.qc
Remove `-Wno-double-declaration`
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / t_teleporters.qc
index 543c1cf0bb66919b8576259587a058f8e7a2fd99..af72d135af2a6e50a907e1f91360e65d7ae4108e 100644 (file)
@@ -13,12 +13,12 @@ void trigger_teleport_use()
        deathmax = (o) + player.maxs; \
        if(telefragmin != telefragmax) \
        { \
-               if(deathmin_x > telefragmin_x) deathmin_x = telefragmin_x; \
-               if(deathmin_y > telefragmin_y) deathmin_y = telefragmin_y; \
-               if(deathmin_z > telefragmin_z) deathmin_z = telefragmin_z; \
-               if(deathmax_x < telefragmax_x) deathmax_x = telefragmax_x; \
-               if(deathmax_y < telefragmax_y) deathmax_y = telefragmax_y; \
-               if(deathmax_z < telefragmax_z) deathmax_z = telefragmax_z; \
+               if(deathmin.x > telefragmin.x) deathmin_x = telefragmin.x; \
+               if(deathmin.y > telefragmin.y) deathmin_y = telefragmin.y; \
+               if(deathmin.z > telefragmin.z) deathmin_z = telefragmin.z; \
+               if(deathmax.x < telefragmax.x) deathmax_x = telefragmax.x; \
+               if(deathmax.y < telefragmax.y) deathmax_y = telefragmax.y; \
+               if(deathmax.z < telefragmax.z) deathmax_z = telefragmax.z; \
        } \
        deathradius = max(vlen(deathmin), vlen(deathmax)); \
        for(head = findradius(o, deathradius); head; head = head.chain) \
@@ -67,18 +67,18 @@ void spawn_tdeath(vector v0, entity e, vector v)
 }
 
 .entity pusher;
-#define TELEPORT_FLAG_SOUND 1
-#define TELEPORT_FLAG_PARTICLES 2
-#define TELEPORT_FLAG_TDEATH 4
-#define TELEPORT_FLAG_FORCE_TDEATH 8
+const float TELEPORT_FLAG_SOUND = 1;
+const float TELEPORT_FLAG_PARTICLES = 2;
+const float TELEPORT_FLAG_TDEATH = 4;
+const float TELEPORT_FLAG_FORCE_TDEATH = 8;
 
 #define TELEPORT_FLAGS_WARPZONE   0
 #define TELEPORT_FLAGS_PORTAL     (TELEPORT_FLAG_SOUND | TELEPORT_FLAG_PARTICLES | TELEPORT_FLAG_TDEATH | TELEPORT_FLAG_FORCE_TDEATH)
 #define TELEPORT_FLAGS_TELEPORTER (TELEPORT_FLAG_SOUND | TELEPORT_FLAG_PARTICLES | TELEPORT_FLAG_TDEATH)
 
 // types for .teleportable entity setting
-#define TELEPORT_NORMAL 1 // play sounds/effects etc
-#define TELEPORT_SIMPLE 2 // only do teleport, nothing special
+const float TELEPORT_NORMAL = 1; // play sounds/effects etc
+const float TELEPORT_SIMPLE = 2; // only do teleport, nothing special
 
 void Reset_ArcBeam(entity player, vector forward);
 void TeleportPlayer(entity teleporter, entity player, vector to, vector to_angles, vector to_velocity, vector telefragmin, vector telefragmax, float tflags)
@@ -114,7 +114,7 @@ void TeleportPlayer(entity teleporter, entity player, vector to, vector to_angle
        setorigin (player, to);
        player.oldorigin = to; // don't undo the teleport by unsticking
        player.angles = to_angles;
-       player.fixangle = TRUE;
+       player.fixangle = true;
        player.velocity = to_velocity;
        BITXOR_ASSIGN(player.effects, EF_TELEPORT_BIT);
 
@@ -170,7 +170,7 @@ entity Simple_TeleportPlayer(entity teleporter, entity player)
                        p = 1;
                        if(autocvar_g_telefrags_avoid)
                        {
-                               locout = e.origin + '0 0 1' * (1 - player.mins_z - 24);
+                               locout = e.origin + '0 0 1' * (1 - player.mins.z - 24);
                                if(check_tdeath(player, locout, '0 0 0', '0 0 0'))
                                        p = 0;
                        }
@@ -191,7 +191,7 @@ entity Simple_TeleportPlayer(entity teleporter, entity player)
                if(vlen(player.velocity) > autocvar_g_teleport_maxspeed)
                        player.velocity = normalize(player.velocity) * max(0, autocvar_g_teleport_maxspeed);
 
-       locout = e.origin + '0 0 1' * (1 - player.mins_z - 24);
+       locout = e.origin + '0 0 1' * (1 - player.mins.z - 24);
        TeleportPlayer(teleporter, player, locout, e.mangle, v_forward * vlen(player.velocity), '0 0 0', '0 0 0', TELEPORT_FLAGS_TELEPORTER);
 
        return e;