From c4c5f64764557dd1338cbeaee2564ef3ea2bbbdb Mon Sep 17 00:00:00 2001 From: Crazylemon64 Date: Mon, 4 Jul 2016 17:11:46 -0700 Subject: [PATCH] Final --- code/game/atoms_movable.dm | 9 ++++++++- code/modules/awaymissions/maploader/reader.dm | 15 ++++++++------- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm index f4fe506229a..e1b68f5cd2b 100644 --- a/code/game/atoms_movable.dm +++ b/code/game/atoms_movable.dm @@ -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() diff --git a/code/modules/awaymissions/maploader/reader.dm b/code/modules/awaymissions/maploader/reader.dm index 104c7fcbb93..e12282b6580 100644 --- a/code/modules/awaymissions/maploader/reader.dm +++ b/code/modules/awaymissions/maploader/reader.dm @@ -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)