From dc67f93a6be1e0d2e35cf7ae4418717b9b6f2bfe Mon Sep 17 00:00:00 2001 From: cypress Date: Fri, 24 Nov 2023 09:32:52 -0500 Subject: [PATCH] SERVER: Prohibit fall damage while teleporting --- source/server/entities/pack_a_punch.qc | 2 +- source/server/entities/teleporter.qc | 14 +++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/source/server/entities/pack_a_punch.qc b/source/server/entities/pack_a_punch.qc index 419261d..b590941 100644 --- a/source/server/entities/pack_a_punch.qc +++ b/source/server/entities/pack_a_punch.qc @@ -358,7 +358,7 @@ void() perk_pap = // // Model - if (!self.model) { + if (!self.model || self.model == "models/machines/hl_scale/pap.mdl") { self.model = "models/machines/quake_scale/pap.mdl"; } diff --git a/source/server/entities/teleporter.qc b/source/server/entities/teleporter.qc index 330728b..d40ad06 100644 --- a/source/server/entities/teleporter.qc +++ b/source/server/entities/teleporter.qc @@ -142,6 +142,9 @@ void(entity who) teleport_entity = setorigin(who, who.origin + '0 0 40'); } + // Prohibit taking fall damage + who.oldz = who.origin_z; + switch(self.iszomb) { case 0: who.origin += '20 0 0'; @@ -166,12 +169,13 @@ void(entity who) teleport_entity = who.weapon2model = ""; who.movetype = MOVETYPE_WALK; - if (who.flags & FL_ONGROUND) { - who.flags = who.flags - FL_ONGROUND; - who.velocity = v_forward * 0; - } + // if (who.flags & FL_ONGROUND) { + // who.flags = who.flags - FL_ONGROUND; + // who.velocity = v_forward * 0; + // } - who.flags = who.flags - who.flags & FL_ONGROUND; + who.flags = who.flags & FL_ONGROUND; + who.velocity = '0 0 0'; } void() teleport_entities =