Skip to content

Commit

Permalink
Merge pull request tgstation#17246 from tgstation/RemieRichards-vote-…
Browse files Browse the repository at this point in the history
…improvements

vote improvements
  • Loading branch information
KorPhaeron committed Apr 30, 2016
2 parents 55514c3 + a5ec86d commit 3f486d8
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions code/controllers/subsystem/voting.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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 << "<span class='warning'>There is already a vote in progress! please wait for it to finish.</span>"
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 << "<span class='warning'>A vote was initiated recently, you must wait roughly [(next_allowed_time-world.time)/10] seconds before a new vote can be started!</span>"
return 0

reset()
Expand Down

0 comments on commit 3f486d8

Please sign in to comment.