]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Update ready and vote counts when a player becomes an observer
authorMario <mario@smbclan.net>
Wed, 13 Sep 2017 02:42:57 +0000 (12:42 +1000)
committerMario <mario@smbclan.net>
Wed, 13 Sep 2017 02:42:57 +0000 (12:42 +1000)
qcsrc/server/client.qc

index 6a978c6aebe631eef3c51e8016815a7697a24a93..52a376b0a5990f56366caa3872406c5a18f92bd8 100644 (file)
@@ -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();
+               }
     }
 
     {