Make map vote rigging 99% less likely to fuck up the server

This commit is contained in:
D3athrow
2020-08-28 15:39:51 -05:00
parent 1b7952787c
commit 6aae6aca47
3 changed files with 18 additions and 9 deletions

View File

@@ -115,16 +115,18 @@
return
vote.choices[winner] = ARBITRARILY_LARGE_NUMBER
else
winner = input(usr,"Add a result.","Add a result","") as text|null
if(!winner)
return
if(vote.ismapvote)
var/path = input(usr,"Add the map path.","Path","") as text|null
winner = input(usr,"Pick a map, choose a duplicate and pomf will hurt you.") as text|anything|null in vote.allmaps
var/path = vote.allmaps[winner]
if(!path)
to_chat(usr,"<span class='warning'>You must specify a path to rig a mapvote!</span>")
return
vote.ismapvote[winner] = path
to_chat(usr,"<span class='info'>Set path as [path]. Hope that's right...</span>")
else
winner = input(usr,"Add a result.","Add a result","") as text|null
if(!winner)
return
vote.choices[winner] = ARBITRARILY_LARGE_NUMBER
message_admins("Admin [key_name_admin(usr)] rigged the vote for [winner].")
log_admin("Admin [key_name(usr)] rigged the vote for [winner]. Choices were [vote.choices.Join(", ")]")