This commit is contained in:
Crazylemon64
2016-07-04 17:11:46 -07:00
parent ac3db33709
commit c4c5f64764
2 changed files with 16 additions and 8 deletions
+8 -1
View File
@@ -31,7 +31,14 @@ var/list/dirty_z_levels = list()
// If you're wondering what goofery this is, this is for things that need the environment
// around them set up - like `air_update_turf` and the like
if(!(T && zlevels.is_zlevel_dirty(T.z)) && auto_init && ticker && ticker.current_state == GAME_STATE_PLAYING)
if(!auto_init)
//no-op
else if((T && zlevels.is_zlevel_dirty(T.z)))
// Also a no-op - maybe add some handling here if you want to try
// make object init on dirtied z-levels succeed - but right now
// the only source of dirty z-levels are admins loading templates and explicitly
// choosing to delay initialization on that level
else if((ticker && ticker.current_state == GAME_STATE_PLAYING))
initialize()
/atom/movable/Destroy()
@@ -48,10 +48,10 @@ var/global/dmm_suite/preloader/_preloader = new
var/list/bounds = list(1.#INF, 1.#INF, 1.#INF, -1.#INF, -1.#INF, -1.#INF)
var/list/grid_models = list()
var/key_len = 0
var/list/touched_z_levels = list()
var/dmm_suite/loaded_map/LM = new
if(measureOnly)
delay_init = 0
// This try-catch is used as a budget "Finally" clause, as the dirt count
// needs to be reset
try
@@ -83,7 +83,7 @@ var/global/dmm_suite/preloader/_preloader = new
var/zcrd = text2num(dmmRegex.group[5]) + z_offset - 1
if(!measureOnly && delay_init)
zlevels.add_dirt(zcrd)
touched_z_levels |= zcrd
LM.touched_z_levels |= zcrd
if(zcrd > world.maxz)
if(cropMap)
@@ -148,13 +148,13 @@ var/global/dmm_suite/preloader/_preloader = new
CHECK_TICK
catch(var/exception/e)
if(!measureOnly && delay_init)
for(var/i in touched_z_levels)
if(delay_init)
for(var/i in LM.touched_z_levels)
zlevels.remove_dirt(i)
throw e
if(!measureOnly && delay_init)
for(var/i in touched_z_levels)
if(delay_init)
for(var/i in LM.touched_z_levels)
zlevels.remove_dirt(i)
qdel(LM)
if(bounds[MAP_MINX] == 1.#INF) // Shouldn't need to check every item
@@ -443,6 +443,7 @@ var/global/dmm_suite/preloader/_preloader = new
// a new area type for each new ruin
/dmm_suite/loaded_map
parent_type = /datum
var/list/touched_z_levels = list()
var/list/area_list = list()
/dmm_suite/loaded_map/proc/area_path_to_real_area(area/A)