mirror of
https://github.com/SPLURT-Station/S.P.L.U.R.T-Station-13.git
synced 2025-12-09 16:07:40 +00:00
adds the ability to actually vote for maps instead of using tg's biased preference-based voting system (#7743)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -685,7 +685,7 @@ GLOBAL_LIST_EMPTY(preferences_datums)
|
||||
dat += "<b>Ambient Occlusion:</b> <a href='?_src_=prefs;preference=ambientocclusion'>[ambientocclusion ? "Enabled" : "Disabled"]</a><br>"
|
||||
dat += "<b>Fit Viewport:</b> <a href='?_src_=prefs;preference=auto_fit_viewport'>[auto_fit_viewport ? "Auto" : "Manual"]</a><br>"
|
||||
|
||||
if (CONFIG_GET(flag/maprotation))
|
||||
if (CONFIG_GET(flag/maprotation) && CONFIG_GET(flag/tgstyle_maprotation))
|
||||
var/p_map = preferred_map
|
||||
if (!p_map)
|
||||
p_map = "Default"
|
||||
|
||||
@@ -363,6 +363,11 @@ ANNOUNCE_ADMIN_LOGOUT
|
||||
## You should edit maps.txt to match your configuration when you enable this.
|
||||
MAPROTATION
|
||||
|
||||
## TG-style map rotation
|
||||
## By default, Citadel uses a more traditional method of map voting, where at the end of a round, players are given a full upfront vote.
|
||||
## This PR will disable that, and will make the server use TG's map rotation instead.
|
||||
#TGSTYLE_MAPROTATION
|
||||
|
||||
## Map voting
|
||||
## Allows players to vote for their preffered map
|
||||
## When it's set to zero, the map will be randomly picked each round
|
||||
|
||||
Reference in New Issue
Block a user