]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Some fixes for voting
authorSamual <samual@xonotic.org>
Sun, 26 Feb 2012 05:16:49 +0000 (00:16 -0500)
committerSamual <samual@xonotic.org>
Sun, 26 Feb 2012 05:16:49 +0000 (00:16 -0500)
defaultXonotic.cfg
qcsrc/server/command/vote.qc

index e4899175eba72fe36d90ce2ff26ac9aa465ca3a4..761ccf075851fbd8b6b4c2c8155af825460c407c 100644 (file)
@@ -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"
index 8769629f96613bf13247f954617b6535e536f55d..97313ca17fd44870a3ea7228b2b7457f985f2866 100644 (file)
@@ -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