From b27dcd603560baa1c3b5baae3e9f1e1f835bd18a Mon Sep 17 00:00:00 2001 From: terencehill Date: Sat, 6 Jan 2024 23:58:34 +0100 Subject: [PATCH] Fix 2 regressions when round starts: players don't respawn and g_freezetag_spectate_enemies is not read again --- .../gamemodes/gamemode/freezetag/sv_freezetag.qc | 13 ++++++++----- ruleset-XPM.cfg | 1 + 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/qcsrc/common/gamemodes/gamemode/freezetag/sv_freezetag.qc b/qcsrc/common/gamemodes/gamemode/freezetag/sv_freezetag.qc index 7676d8aea..812b1081e 100644 --- a/qcsrc/common/gamemodes/gamemode/freezetag/sv_freezetag.qc +++ b/qcsrc/common/gamemodes/gamemode/freezetag/sv_freezetag.qc @@ -522,9 +522,6 @@ MUTATOR_HOOKFUNCTION(ft, PlayerSpawn) { entity player = M_ARGV(0, entity); - if(player.freezetag_frozen_timeout == -1) // if PlayerSpawn is called by reset_map_players - return true; // do nothing, round is starting right now - if(player.freezetag_frozen_timeout == -2) // player died due to teamswitch { freezetag_Freeze(player, NULL); @@ -540,6 +537,8 @@ MUTATOR_HOOKFUNCTION(ft, PlayerSpawn) if (player.lives < 0) return true; + INGAME_STATUS_SET(player, INGAME_STATUS_JOINED); + freezetag_count_alive_players(); if(round_handler_IsActive()) @@ -572,18 +571,22 @@ MUTATOR_HOOKFUNCTION(ft, PutClientInServer) MUTATOR_HOOKFUNCTION(ft, reset_map_players) { + g_freezetag_spectate_enemies = autocvar_g_freezetag_spectate_enemies; + observe_blocked_if_eliminated = (g_freezetag_spectate_enemies == -1); + // we can avoid sending observe_blocked_if_eliminated to all clients here (with ClientData_Touch) + // since it will get sent whenever the client spectates someone anyway + int start_lives = freezetag_Get_Start_Lives(); ft_lowest_lives = start_lives; FOREACH_CLIENT(INGAME(it) || IS_BOT_CLIENT(it), { CS(it).killcount = 0; it.freezetag_revive_time = 0; - it.freezetag_frozen_timeout = -1; + it.freezetag_frozen_timeout = 0; INGAME_STATUS_SET(it, INGAME_STATUS_JOINED); it.lives = start_lives; it.remaining_lives_msg_time = 0; TRANSMUTE(Player, it); PutClientInServer(it); - it.freezetag_frozen_timeout = 0; }); freezetag_count_alive_players(); return true; diff --git a/ruleset-XPM.cfg b/ruleset-XPM.cfg index 50ce89066..29d38290f 100644 --- a/ruleset-XPM.cfg +++ b/ruleset-XPM.cfg @@ -26,3 +26,4 @@ sv_taunt 0 sv_maxidle_playertospectator 0 sv_forbid_pickuptimer 1 // we don't want people seeing their pickup times in competitive matches g_ca_spectate_enemies -1 // block freeroam camera in CA matches +g_freezetag_spectate_enemies -1 // block freeroam camera in FT matches -- 2.39.2