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 18:07:32 +02:00
committed by AnturK
parent 410ad4dc3e
commit 61e70f2333
5 changed files with 167 additions and 152 deletions
+5 -3
View File
@@ -33,7 +33,7 @@ SUBSYSTEM_DEF(mapping)
var/list/z_list
var/datum/space_level/transit
var/datum/space_level/empty_space
var/dmm_suite/loader
var/datum/maploader/loader
/datum/controller/subsystem/mapping/PreInit()
if(!config)
@@ -178,7 +178,8 @@ SUBSYSTEM_DEF(mapping)
var/total_z = 0
for (var/file in files)
var/full_path = "_maps/[path]/[file]"
var/bounds = loader.load_map(file(full_path), 1, 1, 1, cropMap=FALSE, measureOnly=TRUE)
var/datum/parsed_map/pm = loader.load_map(file(full_path), 1, 1, 1, cropMap=FALSE, measureOnly=TRUE)
var/bounds = pm?.bounds
files[file] = total_z // save the start Z of this file
total_z += bounds[MAP_MAXZ] - bounds[MAP_MINZ] + 1
@@ -202,7 +203,8 @@ SUBSYSTEM_DEF(mapping)
// load the maps
for (var/file in files)
var/full_path = "_maps/[path]/[file]"
if(!loader.load_map(file(full_path), 0, 0, start_z + files[file], no_changeturf = TRUE))
var/datum/parsed_map/parsed = loader.load_map(file(full_path), 0, 0, start_z + files[file], no_changeturf = TRUE)
if(!parsed?.bounds)
errorList |= full_path
if(!silent)
INIT_ANNOUNCE("Loaded [name] in [(REALTIMEOFDAY - start_time)/10]s!")