mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 18:22:39 +00:00
Testing init fixes
This commit is contained in:
@@ -37,8 +37,8 @@
|
|||||||
|
|
||||||
// During dynamic mapload (reader.dm) this assigns the var overrides from the .dmm file
|
// 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.
|
// 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()
|
if(GLOB.use_preloader && (src.type == GLOB._preloader.target_path))//in case the instanciated atom is creating other atoms in New()
|
||||||
_preloader.load(src)
|
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.
|
// 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
|
var/do_initialize = SSatoms.initialized
|
||||||
|
|||||||
@@ -2,15 +2,9 @@
|
|||||||
//SS13 Optimized Map loader
|
//SS13 Optimized Map loader
|
||||||
//////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
/*
|
|
||||||
//global datum that will preload variables on atoms instanciation
|
//global datum that will preload variables on atoms instanciation
|
||||||
GLOBAL_VAR_INIT(use_preloader, FALSE)
|
GLOBAL_VAR_INIT(use_preloader, FALSE)
|
||||||
GLOBAL_DATUM_INIT(_preloader, /dmm_suite/preloader, new)
|
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
|
/dmm_suite
|
||||||
// /"([a-zA-Z]+)" = \(((?:.|\n)*?)\)\n(?!\t)|\((\d+),(\d+),(\d+)\) = \{"([a-zA-Z\n]*)"\}/g
|
// /"([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
|
index = members.len
|
||||||
if(members[index] != /area/template_noop)
|
if(members[index] != /area/template_noop)
|
||||||
var/atom/instance
|
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]
|
var/atype = members[index]
|
||||||
for(var/area/A in world)
|
for(var/area/A in world)
|
||||||
if(A.type == atype)
|
if(A.type == atype)
|
||||||
@@ -361,8 +355,8 @@ var/global/use_preloader = FALSE
|
|||||||
if(crds)
|
if(crds)
|
||||||
instance.contents.Add(crds)
|
instance.contents.Add(crds)
|
||||||
|
|
||||||
if(use_preloader && instance)
|
if(GLOB.use_preloader && instance)
|
||||||
_preloader.load(instance)
|
GLOB._preloader.load(instance)
|
||||||
|
|
||||||
//then instance the /turf and, if multiple tiles are presents, simulates the DMM underlays piling effect
|
//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
|
//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)
|
/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(crds)
|
||||||
if(!no_changeturf && ispath(path, /turf))
|
if(!no_changeturf && ispath(path, /turf))
|
||||||
@@ -406,8 +400,8 @@ var/global/use_preloader = FALSE
|
|||||||
else
|
else
|
||||||
. = create_atom(path, crds)//first preloader pass
|
. = create_atom(path, crds)//first preloader pass
|
||||||
|
|
||||||
if(use_preloader && .)//second preloader pass, for those atoms that don't ..() in New()
|
if(GLOB.use_preloader && .)//second preloader pass, for those atoms that don't ..() in New()
|
||||||
_preloader.load(.)
|
GLOB._preloader.load(.)
|
||||||
|
|
||||||
//custom CHECK_TICK here because we don't want things created while we're sleeping to not initialize
|
//custom CHECK_TICK here because we don't want things created while we're sleeping to not initialize
|
||||||
if(TICK_CHECK)
|
if(TICK_CHECK)
|
||||||
@@ -530,7 +524,7 @@ var/global/use_preloader = FALSE
|
|||||||
|
|
||||||
/dmm_suite/preloader/proc/setup(list/the_attributes, path)
|
/dmm_suite/preloader/proc/setup(list/the_attributes, path)
|
||||||
if(the_attributes.len)
|
if(the_attributes.len)
|
||||||
use_preloader = TRUE
|
GLOB.use_preloader = TRUE
|
||||||
attributes = the_attributes
|
attributes = the_attributes
|
||||||
target_path = path
|
target_path = path
|
||||||
|
|
||||||
@@ -540,7 +534,7 @@ var/global/use_preloader = FALSE
|
|||||||
if(islist(value))
|
if(islist(value))
|
||||||
value = deepCopyList(value)
|
value = deepCopyList(value)
|
||||||
what.vars[attribute] = value
|
what.vars[attribute] = value
|
||||||
use_preloader = FALSE
|
GLOB.use_preloader = FALSE
|
||||||
|
|
||||||
/area/template_noop
|
/area/template_noop
|
||||||
name = "Area Passthrough"
|
name = "Area Passthrough"
|
||||||
|
|||||||
Reference in New Issue
Block a user