]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
fix player names of spectators being shown in battle royale
authorJuhu <5894800-Juhu_@users.noreply.gitlab.com>
Sun, 23 Jan 2022 18:16:38 +0000 (19:16 +0100)
committerJuhu <5894800-Juhu_@users.noreply.gitlab.com>
Sun, 23 Jan 2022 18:16:38 +0000 (19:16 +0100)
qcsrc/common/gamemodes/gamemode/br/sv_br.qc
qcsrc/server/client.qc

index a1f13beebdc950f11e19a6e0836afbdb71dbef3c..a54d03da53e3b95cdb10dd359579c92c1d70863f 100644 (file)
@@ -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)
index 34a44cdc4b039a76e272c263c98b11e613a8a955..26535dbb6cd07f0021b48d552872fb984a0dacd9 100644 (file)
@@ -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)
 {