anchor.diff:  	//validate the poll
   	if (!vote_valid_check(pollid, client.holder, POLLTYPE_OPTION))
   		return 0
  -	var/adminrank = sanitizeSQL(poll_check_voted(pollid))
  +	var/voted = poll_check_voted()
  +	if(isnull(voted) || voted) //Failed or already voted.
  +		return
  +	var/adminrank = sanitizeSQL(poll_rank())
   	if(!adminrank)
   		return
   	var/datum/DBQuery/query_option_vote = SSdbcore.NewQuery("INSERT INTO [format_table_name("poll_vote")] (datetime, pollid, optionid, ckey, ip, adminrank) VALUES (Now(), [pollid], [optionid], '[ckey]', INET_ATON('[client.address]'), '[adminrank]')")
  
positive.code: 	if(query_hasvoted.NextRow())
  		qdel(query_hasvoted)
  		to_chat(usr, "<span class='danger'>You've already replied to this poll.</span>")
  		return
  	qdel(query_hasvoted)
  	. = "Player"
  	if(client.holder)
  		. = client.holder.rank.name
  	return .
  
  
  /mob/dead/new_player/proc/vote_rig_check()
  
negative.code: 	if(!replytext)
  		to_chat(usr, "The text you entered was blank. Please correct the text and submit again.")
  		return
  	var/voted = poll_check_voted(pollid, TRUE)
  	if(isnull(voted))
  		return
  	var/adminrank = sanitizeSQL(poll_rank())
  	if(!adminrank)
  		return
  	replytext = sanitizeSQL(replytext)
  	if(!(length(replytext) > 0) || !(length(replytext) <= 8000))
  		to_chat(usr, "The text you entered was invalid or too long. Please correct the text and submit again.")
  		return
  	var/datum/DBQuery/query_text_vote
  	if(!voted)
  		query_text_vote  = SSdbcore.NewQuery("INSERT INTO [format_table_name("poll_textreply")] (datetime ,pollid ,ckey ,ip ,replytext ,adminrank) VALUES (Now(), [pollid], '[ckey]', INET_ATON('[client.address]'), '[replytext]', '[adminrank]')")
  	else
  		query_text_vote  = SSdbcore.NewQuery("UPDATE [format_table_name("poll_textreply")] SET datetime = Now(), ip = INET_ATON('[client.address]'), replytext = '[replytext]' WHERE pollid = '[pollid]' AND ckey = '[ckey]'")
  	if(!query_text_vote.warn_execute())
  		qdel(query_text_vote)
  		return
  