diff --git a/code/controllers/subsystem/persistence/_persistence.dm b/code/controllers/subsystem/persistence/_persistence.dm index 00135bbcc2..4086fe6408 100644 --- a/code/controllers/subsystem/persistence/_persistence.dm +++ b/code/controllers/subsystem/persistence/_persistence.dm @@ -31,7 +31,7 @@ SUBSYSTEM_DEF(persistence) */ /datum/controller/subsystem/persistence/proc/get_map_persistence_path() ASSERT(SSmapping.config) - if(SSmapping.config.persistence_key == "NO_PERSIST") + if(!SSmapping.config.persistence_key || (SSmapping.config.persistence_key == "NO_PERSIST")) return null return "data/persistence/[ckey(SSmapping.config.persistence_key)]" diff --git a/code/controllers/subsystem/persistence/cleanable_debris.dm b/code/controllers/subsystem/persistence/cleanable_debris.dm index 8c9e7ba5c0..430bc871dd 100644 --- a/code/controllers/subsystem/persistence/cleanable_debris.dm +++ b/code/controllers/subsystem/persistence/cleanable_debris.dm @@ -16,13 +16,13 @@ SaveMapDebris() /datum/controller/subsystem/persistence/proc/LoadMapDebris() + if(CONFIG_GET(flag/persistent_debris_only)) + wipe_existing_debris() if(!fexists("[get_map_persistence_path()]/debris.json")) return if(loaded_debris) return loaded_debris = TRUE - if(CONFIG_GET(flag/persistent_debris_only)) - wipe_existing_debris() var/list/allowed_turf_typecache = typecacheof(/turf/open) - typecacheof(/turf/open/space) var/list/allowed_z_cache = list() for(var/z in SSmapping.levels_by_trait(ZTRAIT_STATION)) @@ -104,12 +104,16 @@ message_admins(w) subsystem_log(w) - subsystem_log({" - Debris saving completed: - Total: [global_max] - By type: [english_list(stored_by_type)] - "}) - WRITE_FILE("[get_map_persistence_path()]/debris.json", json_encode(data)) + var/list/bytype = list() + for(var/path in stored_by_type) + bytype += "[path] - [stored_by_type[path]]" + subsystem_log( + {"Debris saving completed: + Total: [stored] + By type: + [bytype.Join("\n")]"} + ) + WRITE_FILE(file("[get_map_persistence_path()]/debris.json"), json_encode(data)) /datum/controller/subsystem/persistence/proc/IsValidDebrisLocation(turf/tile, list/allowed_typecache, list/allowed_zcache, obj/effect/decal/cleanable/type, loading = FALSE) if(!allowed_typecache[tile.type]) diff --git a/code/modules/mapping/map_config.dm b/code/modules/mapping/map_config.dm index 83418462f1..1f4b558e21 100644 --- a/code/modules/mapping/map_config.dm +++ b/code/modules/mapping/map_config.dm @@ -105,10 +105,11 @@ persistence_key = ckey(map_name) var/json_persistence_key = json["persistence_key"] - if(json_persistence_key == "NO_PERSIST") - persistence_key = null - else - persistence_key = json_persistence_key + if(json_persistence_key) + if(json_persistence_key == "NO_PERSIST") + persistence_key = null + else + persistence_key = json_persistence_key // "map_file": "BoxStation.dmm" if (istext(map_file))