]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
New feature: sv_vote_no_stops_vote: Basically, if the vote caller votes no, then...
authorSamual <samual@xonotic.org>
Sat, 24 Dec 2011 16:25:38 +0000 (11:25 -0500)
committerSamual <samual@xonotic.org>
Sat, 24 Dec 2011 16:25:38 +0000 (11:25 -0500)
commands.cfg
qcsrc/server/autocvars.qh
qcsrc/server/command/vote.qc

index fd602081fd9b82958d804bda4f6924315b710507..22002577728ca69ee05c5adc8457b48dc43a4da7 100644 (file)
@@ -230,6 +230,7 @@ set sv_vote_master 1        "Allows the use of the vote master system"
 set sv_vote_master_callable 1 "When set, users can use \"vmaster\" to call a vote to become master of voting commands"
 set sv_vote_master_password "" "when set, users can use \"vlogin PASSWORD\" to log in as master"
 set sv_vote_master_playerlimit 2 "Minimum number of players needed for a player to be allowed to vote for master"
+set sv_vote_no_stops_vote 1 "Allow the vote caller to stop his own vote simply by voting no"
 set sv_vote_singlecount 0      "set to 1 to count votes once after timeout or to 0 to count with every vote"
 set sv_vote_timeout 30 "a vote will timeout after this many seconds"
 set sv_vote_wait 120   "a player can not call a vote again for this many seconds when his vote was not accepted"
index 01de83c39c5689f1deb3b9b227bc81b1647291b6..97eac1032fa60ff701ef9542fa25c186fc02a195 100644 (file)
@@ -1157,6 +1157,7 @@ float autocvar_sv_vote_master_callable;
 string autocvar_sv_vote_master_commands;
 string autocvar_sv_vote_master_password;
 float autocvar_sv_vote_master_playerlimit;
+float autocvar_sv_vote_no_stops_vote;
 float autocvar_sv_vote_nospectators;
 string autocvar_sv_vote_only_commands;
 float autocvar_sv_vote_override_mostrecent;
index ac95b4556c16eb6e4cda0823cb6816489699df8b..b05ee3d27b97e02b699ebf00df4c7b07fde9a9a1 100644 (file)
@@ -765,6 +765,7 @@ void VoteCommand_no(float request, entity caller) // CLIENT ONLY
                {
                        if not(vote_called) { print_to(caller, "^1No vote called."); }
                        else if not(caller.vote_selection == VOTE_SELECT_NULL || autocvar_sv_vote_change) { print_to(caller, "^1You have already voted."); }
+                       else if(((caller == vote_caller) || !caller || caller.vote_master) && autocvar_sv_vote_no_stops_vote) { VoteStop(caller); }
                        
                        else // everything went okay, continue changing vote
                        {