]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix ready counting after someone has gone to spect
authorz411 <z411@omaera.org>
Tue, 18 Jan 2022 20:25:31 +0000 (17:25 -0300)
committerz411 <z411@omaera.org>
Tue, 18 Jan 2022 20:25:31 +0000 (17:25 -0300)
ReadyCount() is now called at the proper time (after the Player has been transmuted to Observer).
This fixes an issue where the game wouldn't start if someone went to spectator and enough players were ready,
because the spectator was still being wrongly counted as a player.

qcsrc/server/client.qc

index 421a1eb5503163a1333d8d1ee9b38395105bf4a2..5d5afe3cb53c3ae2926f5ce327e5de8cff541588 100644 (file)
@@ -238,6 +238,7 @@ void setplayermodel(entity e, string modelname)
 void PutObserverInServer(entity this, bool is_forced)
 {
        bool mutator_returnvalue = MUTATOR_CALLHOOK(MakePlayerObserver, this, is_forced);
+       bool recount_ready = false;
        PlayerState_detach(this);
 
        if (IS_PLAYER(this))
@@ -252,7 +253,7 @@ void PutObserverInServer(entity this, bool is_forced)
                if(IS_REAL_CLIENT(this))
                {
                        if (vote_called) { VoteCount(false); }
-                       ReadyCount();
+                       recount_ready = true;
                }
                entcs_update_players(this);
        }
@@ -311,6 +312,7 @@ void PutObserverInServer(entity this, bool is_forced)
        this.monster_attack = false;
        STAT(HUD, this) = HUD_NORMAL;
        TRANSMUTE(Observer, this);
+       if(recount_ready) ReadyCount();
        this.iscreature = false;
        this.teleportable = TELEPORT_SIMPLE;
        if(this.damagedbycontents)