]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Implement sv_showspectators 2: Only spectators can see the spectators list 1010/head
authorbones_was_here <bones_was_here@xa.org.au>
Sat, 16 Apr 2022 08:38:07 +0000 (18:38 +1000)
committerbones_was_here <bones_was_here@xa.org.au>
Mon, 18 Apr 2022 13:24:18 +0000 (23:24 +1000)
qcsrc/server/client.qc
qcsrc/server/world.qc
xonotic-server.cfg

index 44226c6f576e1a1169a88d9ce7c837e08f925a5d..cab642e67fd9b0f8e65a3eafedb54800e8cc3927 100644 (file)
@@ -137,7 +137,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 (autocvar_sv_showspectators) sf |= BIT(4); // show spectators
+       if (autocvar_sv_showspectators == 1 || (autocvar_sv_showspectators && IS_SPEC(to)))
+                                       sf |= BIT(4); // show spectators
 
        WriteHeader(MSG_ENTITY, ENT_CLIENT_CLIENTDATA);
        WriteByte(MSG_ENTITY, sf);
index 9d4678ffd4814a04aed3a0185828e36dfbf8026a..69eefdc5cdbe76e5a025a5e57e8dfdf2abbd7228 100644 (file)
@@ -495,6 +495,7 @@ void cvar_changes_init()
                BADCVAR("sv_motd");
                BADCVAR("sv_public");
                BADCVAR("sv_showfps");
+               BADCVAR("sv_showspectators");
                BADCVAR("sv_status_privacy");
                BADCVAR("sv_taunt");
                BADCVAR("sv_vote_call");
index c9a22805c8de8eeb128a0d03017bdde9f725059d..8593149805835749a9dc9848804a7113836a6f5b 100644 (file)
@@ -584,7 +584,7 @@ set sv_join_notices_time 15 "how long the alert is shown on the player's screen"
 
 set sv_simple_items 1 "allow or forbid client use of simple items"
 
-set sv_showspectators 1 "Show who's spectating who in the player info panel when client has cl_showspectators on. Shouldn't be used on competitive servers, also disable when watching a suspected cheater"
+set sv_showspectators 1 "Show who's spectating who in the player info panel when client has cl_showspectators on. 1: shouldn't be used on competitive servers, or when watching a suspected cheater. 2: only spectators can see the spectators list"
 
 set sv_damagetext 2 "<= 0: disabled, >= 1: visible to spectators, >= 2: visible to attacker, >= 3: all players see everyone's damage"