X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fmapobjects%2Fteleporters.qc;h=98864129cf20daa9e12d8d562a31995b8bc2e7f3;hb=8141387a9bf057652453a8d4dc530116cf4cc31a;hp=93bfcbb2683e89de0a4da2cfdb96b589e2b374fc;hpb=77a72b8a1d5686ac0ee30d5019f512086bcbaf3e;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/mapobjects/teleporters.qc b/qcsrc/common/mapobjects/teleporters.qc index 93bfcbb26..98864129c 100644 --- a/qcsrc/common/mapobjects/teleporters.qc +++ b/qcsrc/common/mapobjects/teleporters.qc @@ -3,23 +3,20 @@ #if defined(CSQC) #elif defined(MENUQC) #elif defined(SVQC) - #include - #include - #include - #include "../constants.qh" - #include "../mapobjects/subs.qh" - #include "../util.qh" - #include - #include - #include - #include - #include - #include "../deathtypes/all.qh" - #include - #include "../turrets/sv_turrets.qh" - #include "../vehicles/all.qh" - #include - #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include #endif #ifdef SVQC @@ -226,9 +223,18 @@ 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))) + { + // test if player is slower than min + if(STAT(TELEPORT_MINSPEED, player)) + if(vdist(player.velocity, <, STAT(TELEPORT_MINSPEED, player))) + player.velocity = normalize(player.velocity) * max(0, STAT(TELEPORT_MINSPEED, player)); + // test if player is faster than max (or if min is above max) + 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);