From: Samual Date: Wed, 29 Feb 2012 19:18:41 +0000 (-0500) Subject: If there aren't any players at all and there is a vote called, don't automatically... X-Git-Tag: xonotic-v0.6.0~37 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=3cd3626fe585a9fbf482f0f66e389c817b9c0eb8;p=xonotic%2Fxonotic-data.pk3dir.git If there aren't any players at all and there is a vote called, don't automatically reject it (could be an admin vote) --- diff --git a/qcsrc/server/command/vote.qc b/qcsrc/server/command/vote.qc index 97313ca17..0fd9a199c 100644 --- a/qcsrc/server/command/vote.qc +++ b/qcsrc/server/command/vote.qc @@ -250,8 +250,15 @@ void VoteCount() vote_factor_of_voted = bound(0.5, autocvar_sv_vote_majority_factor_of_voted, 0.999); vote_needed_of_voted = floor((vote_accept_count + vote_reject_count) * vote_factor_of_voted) + 1; + // are there any players at all on the server? it could be an admin vote + if(vote_player_count == 0) + { + VoteSpam(0, -1, "yes"); // no players at all, just accept it + VoteAccept(); + return; + } - // finally calculate the result of the vote + // since there ARE players, finally calculate the result of the vote if(vote_accept_count >= vote_needed_overall) { VoteSpam(notvoters, -1, "yes"); // there is enough acceptions to pass the vote