Testing init fixes

This commit is contained in:
Aronai Sieyes
2020-05-10 23:40:47 -04:00
parent ad2d9d058d
commit 7dcd7efd67
2 changed files with 10 additions and 16 deletions

View File

@@ -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"