From: Juhu <5894800-Juhu_@users.noreply.gitlab.com> Date: Tue, 28 Feb 2023 22:43:30 +0000 (+0100) Subject: add support for the target_teleporter KEEP_SPEED spawnflag, clarify origin of spectat... X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=b790402ba06d568bce62aed3c84e000fa44c930c;p=xonotic%2Fxonotic-data.pk3dir.git add support for the target_teleporter KEEP_SPEED spawnflag, clarify origin of spectator only teleport spawnflag --- diff --git a/qcsrc/common/mapobjects/teleporters.qc b/qcsrc/common/mapobjects/teleporters.qc index cadd95f5c..7a725dfe1 100644 --- a/qcsrc/common/mapobjects/teleporters.qc +++ b/qcsrc/common/mapobjects/teleporters.qc @@ -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)); diff --git a/qcsrc/common/mapobjects/trigger/teleport.qh b/qcsrc/common/mapobjects/trigger/teleport.qh index 84f6fb385..7197d57c2 100644 --- a/qcsrc/common/mapobjects/trigger/teleport.qh +++ b/qcsrc/common/mapobjects/trigger/teleport.qh @@ -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)