Merge pull request #14868 from Arturlang/admin_mapsave

buildmode mapgen tool save [ready]
This commit is contained in:
Lin
2021-11-24 17:32:48 +00:00
committed by GitHub
8 changed files with 335 additions and 0 deletions
@@ -672,3 +672,15 @@
if(allowed(user))
return TRUE
to_chat(user, "<span class='notice'>Access denied.</span>")
/obj/structure/closet/on_object_saved(depth)
if(depth >= 10)
return ""
var/dat = ""
for(var/obj/item in contents)
var/metadata = generate_tgm_metadata(item)
dat += "[dat ? ",\n" : ""][item.type][metadata]"
//Save the contents of things inside the things inside us, EG saving the contents of bags inside lockers
var/custom_data = item.on_object_saved(depth++)
dat += "[custom_data ? ",\n[custom_data]" : ""]"
return dat