]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/mapobjects/teleporters.qc
Merge branch 'drjaska/damagetext' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / mapobjects / teleporters.qc
index 339ade52a775cc86462c7f991b82a8d5ba8ac366..651566c71b6fbec9ff4fd7ef5052a14dea7919ce 100644 (file)
@@ -3,21 +3,20 @@
 #if defined(CSQC)
 #elif defined(MENUQC)
 #elif defined(SVQC)
-    #include <lib/warpzone/common.qh>
-    #include <lib/warpzone/util_server.qh>
-    #include <lib/warpzone/server.qh>
-    #include "../constants.qh"
-       #include "../mapobjects/subs.qh"
-    #include "../util.qh"
-    #include <server/weapons/csqcprojectile.qh>
-    #include <server/autocvars.qh>
-    #include <server/constants.qh>
-    #include <server/defs.qh>
-    #include "../deathtypes/all.qh"
-    #include "../turrets/sv_turrets.qh"
-    #include "../vehicles/all.qh"
-    #include "../mapinfo.qh"
-    #include <server/anticheat.qh>
+       #include <common/constants.qh>
+       #include <common/deathtypes/all.qh>
+       #include <common/gamemodes/_mod.qh>
+       #include <common/mapobjects/subs.qh>
+       #include <common/stats.qh>
+       #include <common/turrets/sv_turrets.qh>
+       #include <common/util.qh>
+       #include <common/vehicles/all.qh>
+       #include <common/weapons/_all.qh>
+       #include <lib/warpzone/common.qh>
+       #include <lib/warpzone/server.qh>
+       #include <lib/warpzone/util_server.qh>
+       #include <server/anticheat.qh>
+       #include <server/weapons/csqcprojectile.qh>
 #endif
 
 #ifdef SVQC
@@ -146,9 +145,12 @@ void TeleportPlayer(entity teleporter, entity player, vector to, vector to_angle
 #ifdef SVQC
        if(IS_PLAYER(player))
        {
-               if(tflags & TELEPORT_FLAG_TDEATH)
-                       if(player.takedamage && !IS_DEAD(player) && !g_race && !g_cts && (autocvar_g_telefrags || (tflags & TELEPORT_FLAG_FORCE_TDEATH)))
-                               tdeath(player, teleporter, telefragger, telefragmin, telefragmax);
+               if((tflags & TELEPORT_FLAG_TDEATH) && player.takedamage && !IS_DEAD(player)
+                       && !g_race && !g_cts && (autocvar_g_telefrags || (tflags & TELEPORT_FLAG_FORCE_TDEATH))
+                       && !(round_handler_IsActive() && !round_handler_IsRoundStarted()))
+               {
+                       tdeath(player, teleporter, telefragger, telefragmin, telefragmax);
+               }
 
                // player no longer is on ground
                UNSET_ONGROUND(player);
@@ -221,9 +223,11 @@ entity Simple_TeleportPlayer(entity teleporter, entity player)
                if(vdist(player.velocity, >, e.speed))
                        player.velocity = normalize(player.velocity) * max(0, e.speed);
 
-       if(STAT(TELEPORT_MAXSPEED, player))
-               if(vdist(player.velocity, >, STAT(TELEPORT_MAXSPEED, player)))
-                       player.velocity = normalize(player.velocity) * max(0, STAT(TELEPORT_MAXSPEED, player));
+       if(!(teleporter.classname == "trigger_teleport" && (teleporter.spawnflags & TELEPORT_KEEP_SPEED)) &&
+          !(teleporter.classname == "target_teleporter" && (teleporter.spawnflags & TARGET_TELEPORTER_KEEP_SPEED)))
+               if(STAT(TELEPORT_MAXSPEED, player))
+                       if(vdist(player.velocity, >, STAT(TELEPORT_MAXSPEED, player)))
+                               player.velocity = normalize(player.velocity) * max(0, STAT(TELEPORT_MAXSPEED, player));
 
        locout = e.origin + '0 0 1' * (1 - player.mins.z - 24);
 
@@ -257,7 +261,7 @@ void teleport_findtarget(entity this)
        if(n == 0)
        {
                // no dest!
-               objerror (this, "Teleporter with nonexistant target");
+               objerror (this, "Teleporter with nonexistent target");
                return;
        }
        else if(n == 1)