From ad6bae5a8da77b8f641a4b097377a655f6d81397 Mon Sep 17 00:00:00 2001 From: deathride58 Date: Sat, 17 Nov 2018 01:10:55 -0500 Subject: [PATCH] Makes the voting system track what user voted for what option - makes it possible to change your vote, and shows you what you voted for. --- code/controllers/subsystem/vote.dm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/code/controllers/subsystem/vote.dm b/code/controllers/subsystem/vote.dm index 34ead8e95e..5ab7fe4ec1 100644 --- a/code/controllers/subsystem/vote.dm +++ b/code/controllers/subsystem/vote.dm @@ -160,8 +160,14 @@ SUBSYSTEM_DEF(vote) if(!(usr.ckey in voted)) if(vote && 1<=vote && vote<=choices.len) voted += usr.ckey + voted[usr.ckey] = vote choices[choices[vote]]++ //check this return vote + else if(vote && 1<=vote && vote<=choices.len) + choices[choices[voted[usr.ckey]]]-- + voted[usr.ckey] = vote + choices[choices[vote]]++ + return vote return 0 /datum/controller/subsystem/vote/proc/initiate_vote(vote_type, initiator_key, hideresults)//CIT CHANGE - adds hideresults argument to votes to allow for obfuscated votes @@ -241,9 +247,10 @@ SUBSYSTEM_DEF(vote) . += "Time Left: [time_remaining] s

" if(admin) . += "(Cancel Vote) "