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"
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