Seperates map reader parsing from loading (#38764)

* Seperates map reader parsing from loading

* Compile fixes

* Uhhh, ok dm

* Ugh

* Fix one error...

* FIxes model caching
This commit is contained in:
Jordan Brown
2018-07-13 12:07:32 -04:00
committed by AnturK
parent 410ad4dc3e
commit 61e70f2333
5 changed files with 167 additions and 152 deletions

View File

@@ -21,13 +21,14 @@
return
var/datum/mapGenerator/repair/reload_station_map/mother1 = mother
GLOB.reloading_map = TRUE
var/static/dmm_suite/reloader = new
var/static/datum/maploader/reloader = new
// This is kind of finicky on multi-Z maps but the reader would need to be
// changed to allow Z cropping and that's a mess
var/z_offset = SSmapping.station_start
var/list/bounds
for (var/path in SSmapping.config.GetFullMapPaths())
bounds = reloader.load_map(file(path), measureOnly = FALSE, no_changeturf = FALSE,x_offset = 0, y_offset = 0, z_offset = z_offset, cropMap=TRUE, lower_crop_x = mother1.x_low, lower_crop_y = mother1.y_low, upper_crop_x = mother1.x_high, upper_crop_y = mother1.y_high)
var/datum/parsed_map/parsed = reloader.load_map(file(path), measureOnly = FALSE, no_changeturf = FALSE,x_offset = 0, y_offset = 0, z_offset = z_offset, cropMap=TRUE, lower_crop_x = mother1.x_low, lower_crop_y = mother1.y_low, upper_crop_x = mother1.x_high, upper_crop_y = mother1.y_high)
bounds = parsed?.bounds
z_offset += bounds[MAP_MAXZ] - bounds[MAP_MINZ] + 1
var/list/obj/machinery/atmospherics/atmos_machines = list()