Merge pull request #32007 from lzimann/poll

Selecting multiple choice polls with 1 choice now become a single option poll
This commit is contained in:
Jordan Brown
2017-10-23 20:36:44 -04:00
committed by CitadelStationBot
parent 6360be2041
commit 6199191dd8
+9 -5
View File
@@ -6,7 +6,7 @@
if(!SSdbcore.Connect())
to_chat(src, "<span class='danger'>Failed to establish database connection.</span>")
return
var/polltype = input("Choose poll type.","Poll Type") in list("Single Option","Text Reply","Rating","Multiple Choice", "Instant Runoff Voting")|null
var/polltype = input("Choose poll type.","Poll Type") as null|anything in list("Single Option","Text Reply","Rating","Multiple Choice", "Instant Runoff Voting")
var/choice_amount = 0
switch(polltype)
if("Single Option")
@@ -18,10 +18,14 @@
if("Multiple Choice")
polltype = POLLTYPE_MULTI
choice_amount = input("How many choices should be allowed?","Select choice amount") as num|null
if(choice_amount == 0)
to_chat(src, "Multiple choice poll must have at least one choice allowed.")
else if (choice_amount == null)
return
switch(choice_amount)
if(0)
to_chat(src, "Multiple choice poll must have at least one choice allowed.")
return
if(1)
polltype = POLLTYPE_OPTION
if(null)
return
if ("Instant Runoff Voting")
polltype = POLLTYPE_IRV
else