adds the ability to actually vote for maps instead of using tg's biased preference-based voting system (#7743)

This commit is contained in:
deathride58
2018-11-19 23:10:25 -05:00
committed by kevinz000
parent 870bf3347c
commit a93751bc03
5 changed files with 23 additions and 3 deletions
@@ -250,6 +250,8 @@
/datum/config_entry/flag/maprotation
/datum/config_entry/flag/tgstyle_maprotation
/datum/config_entry/number/maprotatechancedelta
config_entry_value = 0.75
min_val = 0
+5 -2
View File
@@ -449,9 +449,12 @@ SUBSYSTEM_DEF(ticker)
maprotatechecked = 1
//map rotate chance defaults to 75% of the length of the round (in minutes)
if (!prob((world.time/600)*CONFIG_GET(number/maprotatechancedelta)))
if (!prob((world.time/600)*CONFIG_GET(number/maprotatechancedelta)) && CONFIG_GET(flag/tgstyle_maprotation))
return
INVOKE_ASYNC(SSmapping, /datum/controller/subsystem/mapping/.proc/maprotate)
if(CONFIG_GET(flag/tgstyle_maprotation))
INVOKE_ASYNC(SSmapping, /datum/controller/subsystem/mapping/.proc/maprotate)
else
SSvote.initiate_vote("map","server")
/datum/controller/subsystem/ticker/proc/HasRoundStarted()
return current_state >= GAME_STATE_PLAYING
+10
View File
@@ -139,6 +139,12 @@ SUBSYSTEM_DEF(vote)
restart = 1
else
GLOB.master_mode = .
if("map")
var/datum/map_config/VM = config.maplist[.]
message_admins("The map has been voted for and will change to: [VM.map_name]")
log_admin("The map has been voted for and will change to: [VM.map_name]")
if(SSmapping.changemap(config.maplist[.]))
to_chat(world, "<span class='boldannounce'>The map vote has chosen [VM.map_name] for next round!</span>")
if(restart)
var/active_admins = 0
for(var/client/C in GLOB.admins)
@@ -194,6 +200,10 @@ SUBSYSTEM_DEF(vote)
choices.Add("Restart Round","Continue Playing")
if("gamemode")
choices.Add(config.votable_modes)
if("map")
choices.Add(config.maplist)
for(var/i in choices)//this is necessary because otherwise we'll end up with a bunch of /datum/map_config's as the default vote value instead of 0 as intended
choices[i] = 0
if("roundtype") //CIT CHANGE - adds the roundstart secret/extended vote
choices.Add("secret", "extended")
if("custom")