From: Juhu <5894800-Juhu_@users.noreply.gitlab.com> Date: Sun, 23 Jan 2022 18:16:38 +0000 (+0100) Subject: fix player names of spectators being shown in battle royale X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=71fde0444ca7fafd4c7f91da7a41acce403a5b5d;p=xonotic%2Fxonotic-data.pk3dir.git fix player names of spectators being shown in battle royale --- diff --git a/qcsrc/common/gamemodes/gamemode/br/sv_br.qc b/qcsrc/common/gamemodes/gamemode/br/sv_br.qc index a1f13beeb..a54d03da5 100644 --- a/qcsrc/common/gamemodes/gamemode/br/sv_br.qc +++ b/qcsrc/common/gamemodes/gamemode/br/sv_br.qc @@ -131,7 +131,13 @@ MUTATOR_HOOKFUNCTION(br, MakePlayerObserver) { entity player = M_ARGV(0, entity); - return IN_SQUAD(player); + if(IN_SQUAD(player)) + { + player.frags = FRAGS_PLAYER_OUT_OF_GAME; + return true; + } + + return false; } MUTATOR_HOOKFUNCTION(br, SpectateSet) diff --git a/qcsrc/server/client.qc b/qcsrc/server/client.qc index 34a44cdc4..26535dbb6 100644 --- a/qcsrc/server/client.qc +++ b/qcsrc/server/client.qc @@ -235,6 +235,7 @@ void setplayermodel(entity e, string modelname) } bool SpectateNext(entity this); +.bool would_spectate; /** putting a client as observer in the server */ void PutObserverInServer(entity this, bool is_forced) @@ -402,10 +403,7 @@ void PutObserverInServer(entity this, bool is_forced) // force members of alive squads to spectate another squadmate if(IS_REAL_CLIENT(this) && IN_SQUAD(this) && !this.br_squad.br_squad_dead) - { - SpectateNext(this); - TRANSMUTE(Spectator, this); - } + this.would_spectate = true; } int player_getspecies(entity this) @@ -2259,7 +2257,6 @@ bool PlayerThink(entity this) return true; } -.bool would_spectate; // merged SpectatorThink and ObserverThink (old names are here so you can grep for them) void ObserverOrSpectatorThink(entity this) {