diff --git a/code/modules/mapping/map_template.dm b/code/modules/mapping/map_template.dm index 9ee242eaba..382237e5c3 100644 --- a/code/modules/mapping/map_template.dm +++ b/code/modules/mapping/map_template.dm @@ -26,8 +26,11 @@ var/list/obj/structure/cable/cables = list() var/list/atom/atoms = list() - for(var/L in block(locate(bounds[MAP_MINX], bounds[MAP_MINY], bounds[MAP_MINZ]), - locate(bounds[MAP_MAXX], bounds[MAP_MAXY], bounds[MAP_MAXZ]))) + var/list/turfs = block( locate(bounds[MAP_MINX], bounds[MAP_MINY], bounds[MAP_MINZ]), + locate(bounds[MAP_MAXX], bounds[MAP_MAXY], bounds[MAP_MAXZ])) + var/list/border = block(locate(max(bounds[MAP_MINX]-1, 1), max(bounds[MAP_MINY]-1, 1), bounds[MAP_MINZ]), + locate(min(bounds[MAP_MAXX]+1, world.maxx), min(bounds[MAP_MAXY]+1, world.maxy), bounds[MAP_MAXZ])) - turfs + for(var/L in turfs) var/turf/B = L atoms += B for(var/A in B) @@ -37,6 +40,9 @@ continue if(istype(A, /obj/machinery/atmospherics)) atmos_machines += A + for(var/L in border) + var/turf/T = L + T.air_update_turf(TRUE) //calculate adjacent turfs along the border to prevent runtimes SSatoms.InitializeAtoms(atoms) SSmachines.setup_template_powernets(cables) @@ -74,7 +80,7 @@ if(!SSmapping.loading_ruins) //Will be done manually during mapping ss init repopulate_sorted_areas() - + //initialize things that are normally initialized after map load initTemplateBounds(bounds) @@ -94,4 +100,4 @@ //❤ - Cyberboss /proc/load_new_z_level(var/file, var/name) var/datum/map_template/template = new(file, name) - template.load_new_z() \ No newline at end of file + template.load_new_z()