From 89d6f5c5700a155ae7e828378897099b1063d062 Mon Sep 17 00:00:00 2001 From: Erthilo Date: Sat, 23 Jun 2012 15:15:12 +0100 Subject: [PATCH] TG: Commit on behalf of Willox Fixes an exploit with voting Revision: r3760 Author: quartz235 --- code/game/vote.dm | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/code/game/vote.dm b/code/game/vote.dm index 616cae49c55..9dca6300e77 100644 --- a/code/game/vote.dm +++ b/code/game/vote.dm @@ -188,7 +188,7 @@ var/text = "Voting" - var/footer = "
Close" + var/footer = "
Close" if(config.vote_no_dead && usr.stat == 2) @@ -247,7 +247,7 @@ if(src.client.vote == md) text += "
  • [disp]" else - text += "
  • [disp]" + text += "
  • [disp]" text += "[votes[md]>0?" - [votes[md]] vote\s":null]
    " @@ -276,7 +276,7 @@ if(src.client.vote == md) text += "
  • [disp]" else - text += "
  • [disp]" + text += "
  • [disp]" text += "[votes[md]>0?" - [votes[md]] vote\s":null]
    " @@ -315,10 +315,10 @@ else // voting can begin if(config.allow_vote_restart) - text += "Begin restart vote.
    " + text += "Begin restart vote.
    " if(config.allow_vote_mode) if(!ticker || ticker.current_state == 1) - text += "Begin change mode vote.
    " + text += "Begin change mode vote.
    " else text += "Change mode votes are disabled while a round is in progress, vote to restart first.
    " if(src.client.holder) //Strumpetplaya Add - Custom Votes for Admins @@ -337,14 +337,17 @@ /datum/vote/Topic(href, href_list) ..() + //world << "[usr] has activated the vote Topic" - var/mob/M = locate(href_list["voter"]) // mob of player that clicked link + if(href_list["voter"]) + world << "[usr.ckey] has attempted to bypass the voting system." //ckey is easy key + return if(href_list["vclose"]) - if(M) - M << browse(null, "window=vote") - M.client.showvote = 0 + if(usr) + usr << browse(null, "window=vote") + usr.client.showvote = 0 return if(href_list["vmode"]) @@ -415,14 +418,13 @@ vote.voting = 1 // now voting vote.votetime = world.timeofday + config.vote_period*10 // when the vote will end - spawn(config.vote_period*10) vote.endvote() - world << "\red*** A vote to [vote.mode?"change game mode":"restart"] has been initiated by [M.key]." + world << "\red*** A vote to [vote.mode?"change game mode":"restart"] has been initiated by [usr.key]." world << "\red You have [vote.timetext(config.vote_period)] to vote." - log_vote("Voting to [vote.mode ? "change mode" : "restart round"] started by [M.name]/[M.key]") + log_vote("Voting to [vote.mode ? "change mode" : "restart round"] started by [usr.name]/[usr.key]") for(var/mob/CM in world) if(CM.client) @@ -431,17 +433,17 @@ else CM.client.vote = "default" - if(M) M.vote() + if(usr) usr.vote() return return if(href_list["vote"] && vote.voting) - if(M) - M.client.vote = href_list["vote"] + if(usr) + usr.client.vote = href_list["vote"] - //world << "Setting client [M.key]'s vote to: [href_list["vote"]]." + //world << "Setting client [usr.key]'s vote to: [href_list["vote"]]." - M.vote() + usr.vote() return