From 40b1e961873c2d9fc984f7cc0787e49a27c1c0ea Mon Sep 17 00:00:00 2001 From: terencehill Date: Sat, 23 Mar 2019 15:10:38 +0100 Subject: [PATCH] Freeze Tag: instantly respawn players who died when round hasn't started yet --- qcsrc/common/gamemodes/gamemode/freezetag/sv_freezetag.qc | 4 +++- qcsrc/server/constants.qh | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/qcsrc/common/gamemodes/gamemode/freezetag/sv_freezetag.qc b/qcsrc/common/gamemodes/gamemode/freezetag/sv_freezetag.qc index d38becd73..2dfcf4811 100644 --- a/qcsrc/common/gamemodes/gamemode/freezetag/sv_freezetag.qc +++ b/qcsrc/common/gamemodes/gamemode/freezetag/sv_freezetag.qc @@ -361,7 +361,9 @@ MUTATOR_HOOKFUNCTION(ft, PlayerDies) if (STAT(FROZEN, frag_target) == FROZEN_NORMAL) Unfreeze(frag_target, true); freezetag_count_alive_players(); - return true; // let the player die so that he can respawn whenever he wants + frag_target.respawn_time = time; + frag_target.respawn_flags |= RESPAWN_FORCE; + return true; } // Cases DEATH_TEAMCHANGE and DEATH_AUTOTEAMCHANGE are needed to fix a bug whe diff --git a/qcsrc/server/constants.qh b/qcsrc/server/constants.qh index f98d586fb..62a15f680 100644 --- a/qcsrc/server/constants.qh +++ b/qcsrc/server/constants.qh @@ -10,9 +10,9 @@ const int FL_PICKUPITEMS = BIT(19); const int SVC_SETVIEW = 5; -const int RESPAWN_FORCE = 1; -const int RESPAWN_SILENT = 2; -const int RESPAWN_DENY = 4; +const int RESPAWN_FORCE = BIT(0); +const int RESPAWN_SILENT = BIT(1); +const int RESPAWN_DENY = BIT(2); #define EFMASK_CHEAP (EF_ADDITIVE | EF_DOUBLESIDED | EF_FULLBRIGHT | EF_NODEPTHTEST | EF_NODRAW | EF_NOGUNBOB | EF_NOSHADOW | EF_LOWPRECISION | EF_SELECTABLE | EF_TELEPORT_BIT) -- 2.39.2