From: z411 Date: Tue, 18 Jan 2022 20:25:31 +0000 (-0300) Subject: Fix ready counting after someone has gone to spect X-Git-Tag: xonotic-v0.8.5~181^2~2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=b8ee61fcc64e4c4183031a2b5b0d863b42124b3f;p=xonotic%2Fxonotic-data.pk3dir.git 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. --- 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)