From f590d6c5b9082b17e92e2f6305cf410905b595f5 Mon Sep 17 00:00:00 2001 From: Mario Date: Wed, 13 Sep 2017 12:42:57 +1000 Subject: [PATCH] Update ready and vote counts when a player becomes an observer --- qcsrc/server/client.qc | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/qcsrc/server/client.qc b/qcsrc/server/client.qc index 6a978c6ae..52a376b0a 100644 --- a/qcsrc/server/client.qc +++ b/qcsrc/server/client.qc @@ -219,9 +219,20 @@ void PutObserverInServer(entity this) bool mutator_returnvalue = MUTATOR_CALLHOOK(MakePlayerObserver, this); PlayerState_detach(this); - if (IS_PLAYER(this) && this.health >= 1) { - // despawn effect - Send_Effect(EFFECT_SPAWN_NEUTRAL, this.origin, '0 0 0', 1); + if (IS_PLAYER(this)) + { + if(this.health >= 1) + { + // despawn effect + Send_Effect(EFFECT_SPAWN_NEUTRAL, this.origin, '0 0 0', 1); + } + + // was a player, recount votes and ready status + if(IS_REAL_CLIENT(this)) + { + VoteCount(false); + ReadyCount(); + } } { -- 2.39.2