From 2d24960603ca4a31fe88578b54c1ce13ef6b5af9 Mon Sep 17 00:00:00 2001 From: PsiOmega Date: Sun, 26 Jul 2015 10:45:05 +0200 Subject: [PATCH] Fixes #9894 some more. Ensures the vote sanity check is done first, before any change of vote counts. --- code/controllers/voting.dm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code/controllers/voting.dm b/code/controllers/voting.dm index 707880ff55..2bd56163d5 100644 --- a/code/controllers/voting.dm +++ b/code/controllers/voting.dm @@ -188,9 +188,9 @@ datum/controller/vote if(mode) if(config.vote_no_dead && usr.stat == DEAD && !usr.client.holder) return 0 - if(current_votes[ckey]) - choices[choices[current_votes[ckey]]]-- - if(vote && 1<=vote && vote<=choices.len) + if(vote && vote >= 1 && vote <= choices.len) + if(current_votes[ckey]) + choices[choices[current_votes[ckey]]]-- voted += usr.ckey choices[choices[vote]]++ //check this current_votes[ckey] = vote