From 6401bb8264708d3fc55c22fd6f7ba261aebc11ee Mon Sep 17 00:00:00 2001 From: Jordan Brown Date: Fri, 15 Sep 2017 09:23:01 -0400 Subject: [PATCH] Fixes random gamemode instantiation --- code/controllers/configuration.dm | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/code/controllers/configuration.dm b/code/controllers/configuration.dm index 2d2db546a5c..03245b5450c 100644 --- a/code/controllers/configuration.dm +++ b/code/controllers/configuration.dm @@ -949,11 +949,12 @@ GLOBAL_PROTECT(config_dir) /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). + // ^ This guy didn't try hard enough for(var/T in gamemode_cache) - 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 + var/ct = initial(M.config_tag) + if(ct && ct == mode_name) + return new T return new /datum/game_mode/extended() /datum/configuration/proc/get_runnable_modes()