Fixes #9894 some more.

Ensures the vote sanity check is done first, before any change of vote counts.
This commit is contained in:
PsiOmega
2015-07-26 10:45:05 +02:00
parent ba467899f4
commit 2d24960603

View File

@@ -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