]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Recount votes when a player leaves, also don't count votes from connecting clients
authorMario <mario@smbclan.net>
Sun, 28 Feb 2016 22:49:08 +0000 (08:49 +1000)
committerMario <mario@smbclan.net>
Sun, 28 Feb 2016 22:49:08 +0000 (08:49 +1000)
qcsrc/server/cl_client.qc
qcsrc/server/command/vote.qc
qcsrc/server/command/vote.qh

index 5328e959fbbeffca0eb39c22a5e802fb9d027cd7..e683a4e2438e50289eb595f1dfd9995114608301 100644 (file)
@@ -1244,6 +1244,7 @@ void ClientDisconnect ()
 
        self.playerid = 0;
        ReadyCount();
+       VoteCount(false);
 
        // free cvars
        GetCvars(-1);
index 76f08bdc9f4453f56e471406bc6b2cd92f6ab61c..223bbeb099497d618f074385353585e284230cf1 100644 (file)
@@ -215,7 +215,7 @@ void VoteCount(float first_count)
        Nagger_VoteCountChanged();
 
        // add up all the votes from each connected client
-       FOREACH_CLIENT(IS_REAL_CLIENT(it), LAMBDA(
+       FOREACH_CLIENT(IS_REAL_CLIENT(it) && IS_CLIENT(it), LAMBDA(
                ++vote_player_count;
                if (IS_PLAYER(it))   ++vote_real_player_count;
                switch (it.vote_selection)
index 98b000e75d3c6f624e48f88acbef9b16dee36ea0..0cab6c1d4a7559bcd5cf9f9381b664ebc79d2486 100644 (file)
@@ -54,4 +54,5 @@ float restart_mapalreadyrestarted; // bool, indicates whether reset_map() was al
 void reset_map(float dorespawn);
 void ReadyCount();
 void ReadyRestart_force();
+void VoteCount(float first_count);
 #endif