From 3cd3626fe585a9fbf482f0f66e389c817b9c0eb8 Mon Sep 17 00:00:00 2001 From: Samual Date: Wed, 29 Feb 2012 14:18:41 -0500 Subject: [PATCH] If there aren't any players at all and there is a vote called, don't automatically reject it (could be an admin vote) --- qcsrc/server/command/vote.qc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/qcsrc/server/command/vote.qc b/qcsrc/server/command/vote.qc index 97313ca17f..0fd9a199cb 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 -- 2.39.2