mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 10:21:11 +00:00
Re-added the default-vote config option for voting. For every client connected more than the total votes, it will add 1 to the default vote option (No restart or the current game-mode).
/obj/admins is now /datum/admins because that's what datums are for you silly people Moved var/datum/marked_datum from /obj/ to /datum/admins admin datums are persistent throughout the round. They are stored in the var/list/admins rather than the ranks. This is so admin preferences may be moved into the datum to have them persist even after Login/Logout/Disconnects. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4749 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
@@ -53,10 +53,25 @@ datum/controller/vote
|
||||
proc/get_result()
|
||||
//get the highest number of votes
|
||||
var/greatest_votes = 0
|
||||
var/total_votes = 0
|
||||
for(var/option in choices)
|
||||
var/votes = choices[option]
|
||||
total_votes += votes
|
||||
if(votes > greatest_votes)
|
||||
greatest_votes = votes
|
||||
//default-vote for everyone who didn't vote
|
||||
if(!config.vote_no_default && choices.len)
|
||||
var/non_voters = (client_list.len - total_votes)
|
||||
if(non_voters > 0)
|
||||
if(mode == "restart")
|
||||
choices["Continue Playing"] += non_voters
|
||||
if(choices["Continue Playing"] >= greatest_votes)
|
||||
greatest_votes = choices["Continue Playing"]
|
||||
else if(mode == "gamemode")
|
||||
if(master_mode in choices)
|
||||
choices[master_mode] += non_voters
|
||||
if(choices[master_mode] >= greatest_votes)
|
||||
greatest_votes = choices[master_mode]
|
||||
//get all options with that many votes and return them in a list
|
||||
. = list()
|
||||
if(greatest_votes)
|
||||
|
||||
Reference in New Issue
Block a user