From: Samual Date: Sun, 26 Feb 2012 05:16:49 +0000 (-0500) Subject: Some fixes for voting X-Git-Tag: xonotic-v0.6.0~42^2~3 X-Git-Url: http://git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=commitdiff_plain;h=044ba629958802da76ffe99706c7c056861dae53 Some fixes for voting --- diff --git a/defaultXonotic.cfg b/defaultXonotic.cfg index e4899175eb..761ccf0758 100644 --- a/defaultXonotic.cfg +++ b/defaultXonotic.cfg @@ -192,7 +192,7 @@ set g_warmup_allguns 1 "if set players start with all guns in warmup mode" set g_warmup_majority_factor 0.8 "minimum percentage of players ready needed for warmup to end" set g_chat_nospectators 0 "if 0 spec/observer chat is always visible to the player, if 1 it is never visible to players, if 2 it is only visible to players during warmup stage" -set sv_vote_nospectators 0 "if set only players can call a vote (thus spectators and observers can't call a vote)" +set sv_vote_nospectators 0 "Only players can call a vote (thus spectators and observers can't call a vote): 0 = all people can vote, 1 = spectators can vote in warmup stage, 2 = only players can vote (no exceptions)." alias g_tourney "g_tourney_$1" alias g_tourney_1 "g_warmup 1; g_chat_nospectators 2; sv_vote_nospectators 1" diff --git a/qcsrc/server/command/vote.qc b/qcsrc/server/command/vote.qc index 8769629f96..97313ca17f 100644 --- a/qcsrc/server/command/vote.qc +++ b/qcsrc/server/command/vote.qc @@ -728,8 +728,13 @@ void VoteCommand_master(float request, entity caller, float argc, string vote_co default: // calling a vote for master { + float spectators_allowed = ((autocvar_sv_vote_nospectators != 2) + || ((autocvar_sv_vote_nospectators == 1) && inWarmupStage) + || (autocvar_sv_vote_nospectators == 0)); + if not(autocvar_sv_vote_master_callable) { print_to(caller, "^1Vote to become vote master is not allowed."); } else if(vote_called) { print_to(caller, "^1There is already a vote called."); } + else if(!spectators_allowed && (caller && (caller.classname != "player"))) { print_to(caller, "^1Only players can call a vote."); } else if(timeout_status) { print_to(caller, "^1You can not call a vote while a timeout is active."); } else // everything went okay, continue with creating vote