From b8ee61fcc64e4c4183031a2b5b0d863b42124b3f Mon Sep 17 00:00:00 2001 From: z411 Date: Tue, 18 Jan 2022 17:25:31 -0300 Subject: [PATCH] Fix ready counting after someone has gone to spect 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 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/qcsrc/server/client.qc b/qcsrc/server/client.qc index 421a1eb55..5d5afe3cb 100644 --- a/qcsrc/server/client.qc +++ b/qcsrc/server/client.qc @@ -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) -- 2.39.2