makes loaded templates call air_update_turf() on bordering turfs (#31738)

* makes loaded templates call air_update_turf() on bordering turfs

* safety check for OOB turfs; fixes compile error
This commit is contained in:
duncathan salt
2017-10-15 18:34:19 -06:00
committed by CitadelStationBot
parent be2dc49384
commit fcab4e8a59
+10 -4
View File
@@ -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()
template.load_new_z()