From 7dcd7efd67e48db5a4f1922b510e7df60306bbf0 Mon Sep 17 00:00:00 2001 From: Aronai Sieyes Date: Sun, 10 May 2020 23:40:47 -0400 Subject: [PATCH] Testing init fixes --- code/game/atoms.dm | 4 ++-- code/modules/maps/tg/reader.dm | 22 ++++++++-------------- 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/code/game/atoms.dm b/code/game/atoms.dm index ab703fa650..123daae654 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -37,8 +37,8 @@ // During dynamic mapload (reader.dm) this assigns the var overrides from the .dmm file // Native BYOND maploading sets those vars before invoking New(), by doing this FIRST we come as close to that behavior as we can. - if(use_preloader && (src.type == _preloader.target_path))//in case the instanciated atom is creating other atoms in New() - _preloader.load(src) + if(GLOB.use_preloader && (src.type == GLOB._preloader.target_path))//in case the instanciated atom is creating other atoms in New() + GLOB._preloader.load(src) // Pass our arguments to InitAtom so they can be passed to initialize(), but replace 1st with if-we're-during-mapload. var/do_initialize = SSatoms.initialized diff --git a/code/modules/maps/tg/reader.dm b/code/modules/maps/tg/reader.dm index 71adb65bad..ffbc13be57 100644 --- a/code/modules/maps/tg/reader.dm +++ b/code/modules/maps/tg/reader.dm @@ -2,15 +2,9 @@ //SS13 Optimized Map loader ////////////////////////////////////////////////////////////// -/* //global datum that will preload variables on atoms instanciation GLOBAL_VAR_INIT(use_preloader, FALSE) GLOBAL_DATUM_INIT(_preloader, /dmm_suite/preloader, new) -*/ - -//global datum that will preload variables on atoms instanciation -var/global/dmm_suite/preloader/_preloader = new() -var/global/use_preloader = FALSE /dmm_suite // /"([a-zA-Z]+)" = \(((?:.|\n)*?)\)\n(?!\t)|\((\d+),(\d+),(\d+)\) = \{"([a-zA-Z\n]*)"\}/g @@ -350,7 +344,7 @@ var/global/use_preloader = FALSE index = members.len if(members[index] != /area/template_noop) var/atom/instance - _preloader.setup(members_attributes[index])//preloader for assigning set variables on atom creation + GLOB._preloader.setup(members_attributes[index])//preloader for assigning set variables on atom creation var/atype = members[index] for(var/area/A in world) if(A.type == atype) @@ -361,8 +355,8 @@ var/global/use_preloader = FALSE if(crds) instance.contents.Add(crds) - if(use_preloader && instance) - _preloader.load(instance) + if(GLOB.use_preloader && instance) + GLOB._preloader.load(instance) //then instance the /turf and, if multiple tiles are presents, simulates the DMM underlays piling effect @@ -398,7 +392,7 @@ var/global/use_preloader = FALSE //Instance an atom at (x,y,z) and gives it the variables in attributes /dmm_suite/proc/instance_atom(path,list/attributes, turf/crds, no_changeturf, orientation=0) - _preloader.setup(attributes, path) + GLOB._preloader.setup(attributes, path) if(crds) if(!no_changeturf && ispath(path, /turf)) @@ -406,8 +400,8 @@ var/global/use_preloader = FALSE else . = create_atom(path, crds)//first preloader pass - if(use_preloader && .)//second preloader pass, for those atoms that don't ..() in New() - _preloader.load(.) + if(GLOB.use_preloader && .)//second preloader pass, for those atoms that don't ..() in New() + GLOB._preloader.load(.) //custom CHECK_TICK here because we don't want things created while we're sleeping to not initialize if(TICK_CHECK) @@ -530,7 +524,7 @@ var/global/use_preloader = FALSE /dmm_suite/preloader/proc/setup(list/the_attributes, path) if(the_attributes.len) - use_preloader = TRUE + GLOB.use_preloader = TRUE attributes = the_attributes target_path = path @@ -540,7 +534,7 @@ var/global/use_preloader = FALSE if(islist(value)) value = deepCopyList(value) what.vars[attribute] = value - use_preloader = FALSE + GLOB.use_preloader = FALSE /area/template_noop name = "Area Passthrough"