]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
add support for the target_teleporter KEEP_SPEED spawnflag, clarify origin of spectat...
authorJuhu <5894800-Juhu_@users.noreply.gitlab.com>
Tue, 28 Feb 2023 22:43:30 +0000 (23:43 +0100)
committerJuhu <5894800-Juhu_@users.noreply.gitlab.com>
Tue, 28 Feb 2023 22:43:30 +0000 (23:43 +0100)
qcsrc/common/mapobjects/teleporters.qc
qcsrc/common/mapobjects/trigger/teleport.qh

index cadd95f5ce5388c7d77bec29cea69e820425f31c..7a725dfe155f9bf52c3cb2f6c05f592b3de05e6f 100644 (file)
@@ -223,7 +223,8 @@ entity Simple_TeleportPlayer(entity teleporter, entity player)
                if(vdist(player.velocity, >, e.speed))
                        player.velocity = normalize(player.velocity) * max(0, e.speed);
 
-       if(!(teleporter.classname == "trigger_teleport" && teleporter.spawnflags & TELEPORT_KEEP_SPEED))
+       if(!(teleporter.classname == "trigger_teleport" && teleporter.spawnflags & TELEPORT_KEEP_SPEED) &&
+          !(teleporter.classname == "target_teleporter" && teleporter.spawnflags & 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));
index 84f6fb3858e7f03a15b4eefb52eb77c4bff627b0..7197d57c23c13e5dadd36aae9c376e6354311f02 100644 (file)
@@ -1,5 +1,11 @@
 #pragma once
 
 
-#define TELEPORT_SPECTATOR BIT(0) // q3df compat, also useful in xonotic
-#define TELEPORT_KEEP_SPEED BIT(1) // q3df compat, also useful in xonotic
+// q3df compat spawnflags, they may also be useful in xonotic
+
+// trigger_teleport
+#define TELEPORT_SPECTATOR BIT(0) // exists in q3 but is only documented in q3df
+#define TELEPORT_KEEP_SPEED BIT(1)
+
+// target_teleporter
+#define TELEPORTER_KEEP_SPEED BIT(0)