]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/mapobjects/teleporters.qh
Merge branch 'master' into Lyberta/WaypointIcons
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / mapobjects / teleporters.qh
index 68c5114f4d5bbf06d398f27b32584551737e42a8..10c4fdfafc62cf6d5403561e59d6ff44f0d07a2a 100644 (file)
@@ -15,6 +15,7 @@ const int TELEPORT_FLAG_FORCE_TDEATH = BIT(3);
 #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)
 
+.float teleportable;
 // types for .teleportable entity setting
 const int TELEPORT_NORMAL = 1; // play sounds/effects etc
 const int TELEPORT_SIMPLE = 2; // only do teleport, nothing special
@@ -34,12 +35,8 @@ void TeleportPlayer(entity teleporter, entity player, vector to, vector to_angle
 void trigger_teleport_use(entity this, entity actor, entity trigger);
 
 #define TDEATHLOOP(o) \
-       entity head; \
-       vector deathmin; \
-       vector deathmax; \
-       float deathradius; \
-       deathmin = (o) + player.mins; \
-       deathmax = (o) + player.maxs; \
+       vector deathmin = (o) + player.mins; \
+       vector deathmax = (o) + player.maxs; \
        if(telefragmin != telefragmax) \
        { \
                if(deathmin.x > telefragmin.x) deathmin.x = telefragmin.x; \
@@ -49,11 +46,9 @@ void trigger_teleport_use(entity this, entity actor, entity trigger);
                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) \
-               if(head != player) \
-                       if(head.takedamage) \
-                               if(boxesoverlap(deathmin, deathmax, head.absmin, head.absmax))
+       float deathradius = max(vlen(deathmin), vlen(deathmax)); \
+       for (entity head = findradius(o, deathradius); head; head = head.chain) \
+               if (head != player && head.takedamage && boxesoverlap(deathmin, deathmax, head.absmin, head.absmax))
 
 float check_tdeath(entity player, vector org, vector telefragmin, vector telefragmax);
 float tdeath_hit;