From a5ec86da08bb943dab3f1ed13d4cf18d61391db5 Mon Sep 17 00:00:00 2001 From: Remie Richards Date: Fri, 29 Apr 2016 17:17:49 +0100 Subject: [PATCH] vote improvements Lets admins skip vote wait (so long as one isn't in progress), gives feedback to people who try to start a vote too soon. --- code/controllers/subsystem/voting.dm | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/code/controllers/subsystem/voting.dm b/code/controllers/subsystem/voting.dm index 0549457940e..6279e25fc84 100644 --- a/code/controllers/subsystem/voting.dm +++ b/code/controllers/subsystem/voting.dm @@ -145,9 +145,19 @@ var/datum/subsystem/vote/SSvote /datum/subsystem/vote/proc/initiate_vote(vote_type, initiator_key) if(!mode) - if(started_time != null) + if(started_time) var/next_allowed_time = (started_time + config.vote_delay) - if(next_allowed_time > world.time) + if(mode) + usr << "There is already a vote in progress! please wait for it to finish." + return 0 + + var/admin = FALSE + var/ckey = ckey(initiator_key) + if((admin_datums[ckey]) || (ckey in deadmins)) + admin = TRUE + + if(next_allowed_time > world.time && !admin) + usr << "A vote was initiated recently, you must wait roughly [(next_allowed_time-world.time)/10] seconds before a new vote can be started!" return 0 reset()