]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Let spectators observe in CA either way
authorz411 <z411@omaera.org>
Wed, 19 Oct 2022 22:56:56 +0000 (19:56 -0300)
committerz411 <z411@omaera.org>
Wed, 19 Oct 2022 22:56:56 +0000 (19:56 -0300)
qcsrc/common/gamemodes/gamemode/clanarena/sv_clanarena.qc
qcsrc/server/client.qc

index 4bfc47c7d8962bf6ceb4feaca5301416d3348077..eb9a32b24b4acf0a3bb5846e7b8e315efdacecdf 100644 (file)
@@ -366,11 +366,13 @@ MUTATOR_HOOKFUNCTION(ca, MakePlayerObserver)
                INGAME_STATUS_CLEAR(player);
        }
        if (INGAME(player))
+       {
                player.frags = FRAGS_PLAYER_OUT_OF_GAME;
+               if (autocvar_g_ca_spectate_enemies == -1)
+                       player.would_spectate = true; // force to spectate only
+       }
        if (!warmup_stage)
                eliminatedPlayers.SendFlags |= 1;
-       if (autocvar_g_ca_spectate_enemies == -1)
-               player.would_spectate = true; // force to spectate only
        if (!INGAME(player))
                return false;  // allow team reset
        return true;  // prevent team reset
index c5c79ed02921cb6713de634246cc593b29431f4a..4a4d157b4c2c98d1361d0beb2d6d387f7645a60e 100644 (file)
@@ -138,7 +138,8 @@ bool ClientData_Send(entity this, entity to, int sf)
        if (CS(e).race_completed)       sf |= BIT(0); // forced scoreboard
        if (CS(to).spectatee_status)    sf |= BIT(1); // spectator ent number follows
        if (CS(e).zoomstate)            sf |= BIT(2); // zoomed
-       if (observe_blocked)            sf |= BIT(3); // observing blocked
+       if (observe_blocked && INGAME(to))
+                                       sf |= BIT(3); // observing blocked
        if (autocvar_sv_showspectators == 1 || (autocvar_sv_showspectators && IS_SPEC(to)))
                                        sf |= BIT(4); // show spectators
 
@@ -2254,7 +2255,7 @@ void ObserverOrSpectatorThink(entity this)
                                }
                                CS(this).impulse = 0;
                        } else if(PHYS_INPUT_BUTTON_ATCK2(this)) {
-                               if(!observe_blocked) {
+                               if(!observe_blocked || !INGAME(this)) {
                                        this.would_spectate = false;
                                        this.flags &= ~FL_JUMPRELEASED;
                                        TRANSMUTE(Observer, this);