]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Make sv_spectate to strictly forbid spectating, clients that can't join or are forcef...
authorDamián Viano <dviano@damianv.com.ar>
Tue, 18 Jun 2024 12:31:32 +0000 (09:31 -0300)
committerDamián Viano <dviano@damianv.com.ar>
Tue, 25 Jun 2024 15:46:20 +0000 (12:46 -0300)
Fix #2884.

qcsrc/server/client.qc

index 6b2b73f1fc610da85b417eb4e96c0dc8d47ed8b6..c97f09c777424fb198c2c6b4b0501de71e50d672 100644 (file)
@@ -2700,6 +2700,8 @@ void PlayerFrame (entity this)
        anticheat_prethink(this);
 
        // Check if spectating is allowed
+       if (!autocvar_sv_spectate) blockSpectators = 1;
+
        if (blockSpectators && IS_REAL_CLIENT(this)
        && (IS_SPEC(this) || IS_OBSERVER(this)) && !INGAME(this)
        && time > (CS(this).spectatortime + autocvar_g_maxplayers_spectator_blocktime))