mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-17 18:13:34 +01:00
may work
This commit is contained in:
@@ -200,21 +200,17 @@
|
||||
var/disable_high_pop_mc_mode_amount = 60
|
||||
|
||||
/datum/configuration/New()
|
||||
var/list/L = subtypesof(/datum/game_mode)
|
||||
for(var/T in L)
|
||||
// I wish I didn't have to instance the game modes in order to look up
|
||||
// their information, but it is the only way (at least that I know of).
|
||||
var/datum/game_mode/M = new T()
|
||||
for(var/T in subtypesof(/datum/game_mode))
|
||||
var/datum/game_mode/M = T
|
||||
|
||||
if(M.config_tag)
|
||||
if(!(M.config_tag in modes)) // ensure each mode is added only once
|
||||
diary << "Adding game mode [M.name] ([M.config_tag]) to configuration."
|
||||
src.modes += M.config_tag
|
||||
src.mode_names[M.config_tag] = M.name
|
||||
src.probabilities[M.config_tag] = M.probability
|
||||
if(M.votable)
|
||||
src.votable_modes += M.config_tag
|
||||
qdel(M)
|
||||
if(initial(M.config_tag))
|
||||
if(!(initial(M.config_tag) in modes)) // ensure each mode is added only once
|
||||
diary << "Adding game mode [initial(M.name)] ([initial(M.config_tag)]) to configuration."
|
||||
src.modes += initial(M.config_tag)
|
||||
src.mode_names[initial(M.config_tag)] = initial(M.name)
|
||||
src.probabilities[initial(M.config_tag)] = initial(M.probability)
|
||||
if(initial(M.votable))
|
||||
src.votable_modes += initial(M.config_tag)
|
||||
src.votable_modes += "secret"
|
||||
|
||||
/datum/configuration/proc/load(filename, type = "config") //the type can also be game_options, in which case it uses a different switch. not making it separate to not copypaste code - Urist
|
||||
@@ -750,13 +746,10 @@
|
||||
config.overflow_whitelist += t
|
||||
|
||||
/datum/configuration/proc/pick_mode(mode_name)
|
||||
// I wish I didn't have to instance the game modes in order to look up
|
||||
// their information, but it is the only way (at least that I know of).
|
||||
for(var/T in subtypesof(/datum/game_mode))
|
||||
var/datum/game_mode/M = new T()
|
||||
if(M.config_tag && M.config_tag == mode_name)
|
||||
return M
|
||||
qdel(M)
|
||||
var/datum/game_mode/M = T
|
||||
if(initial(M.config_tag) && initial(M.config_tag) == mode_name)
|
||||
return new T()
|
||||
return new /datum/game_mode/extended()
|
||||
|
||||
/datum/configuration/proc/get_runnable_modes()
|
||||
@@ -773,4 +766,4 @@
|
||||
if(M.can_start())
|
||||
runnable_modes[M] = probabilities[M.config_tag]
|
||||
// to_chat(world, "DEBUG: runnable_mode\[[runnable_modes.len]\] = [M.config_tag]")
|
||||
return runnable_modes
|
||||
return runnable_modes
|
||||
Reference in New Issue
Block a user