]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix 2 regressions when round starts: players don't respawn and g_freezetag_spectate_e...
authorterencehill <piuntn@gmail.com>
Sat, 6 Jan 2024 22:58:34 +0000 (23:58 +0100)
committerterencehill <piuntn@gmail.com>
Sun, 7 Jan 2024 12:00:00 +0000 (13:00 +0100)
qcsrc/common/gamemodes/gamemode/freezetag/sv_freezetag.qc
ruleset-XPM.cfg

index 7676d8aea1d5d70328a520ed298fe2665fed7e30..812b1081e88defb8deb1f07f5f8dbb10f57e4ff8 100644 (file)
@@ -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;
index 50ce89066c17fc972ba5be7546c7698e2c9cb7b7..29d38290f264be2b65e5773139b5010d90669b8a 100644 (file)
@@ -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