Fix map_export admin verb not saving objects properly (#90998)

## About The Pull Request

When using the `map_export` admin verb the following things are fixed:
- All objects density, anchored, opacity, atom_integrity, and
resistance_flags vars are saved
- Multi-tile objects being spammed on all tiles the sprite reaches
- Dirt decals error icon
- Airlocks error icon and to save welded state
- Dark Wizard Simple Mobs error icon
- Closets to save welded, open, and locked states
- Air alarms to save name
- Air scrubbers/vents to save name and welded states
- APCs to save name, charge, cell, lighting, equipment, and
environmental states
- APCs spawning a duplicated terminal underneath it when one already
exists
- SMES to save charge, input, and output states
- Holodecks to revert any holodeck turfs to the empty turf and skip
saving any hologram items
- Photos and Paintings error icons
- Bloody Footprints error icons
- False Walls error icons
- Docking Ports runtimes because the map template var would change
- Effects (lasers, portals, beams, sparks, etc.) saving when they should
be omitted

I would have loved to get `component_parts` to save for machines and
turf decals, but perhaps that is for another day since it requires
complicated solutions.

Here are some before and after pictures:


![StrongDMM_209k6PXSaQ](https://github.com/user-attachments/assets/27f0a80b-3cbc-4862-a218-612d52fa0e4f)


![StrongDMM_5PdRfLTZ4l](https://github.com/user-attachments/assets/3bbfd724-4b51-47c5-8cff-02687250fc1e)


![StrongDMM_F4DPOGz5K7](https://github.com/user-attachments/assets/1130ded8-3062-469a-ad4a-d437d89a68da)


![StrongDMM_BIa554dsGv](https://github.com/user-attachments/assets/440d6b38-dbbf-47c0-ad9a-5165504d104e)

## Why It's Good For The Game
Better map saving code.

## Changelog
🆑
fix: Fix `map_export` admin verb not properly saving a massive amount of
objects.
/🆑
This commit is contained in:
Tim
2025-05-16 22:43:09 -07:00
committed by GitHub
parent 62fcace82c
commit e698c965b3
17 changed files with 172 additions and 39 deletions
@@ -6,11 +6,16 @@
/// Map template to load when the dock is loaded
var/datum/map_template/shuttle/roundstart_template
/// The shuttle template id to use after roundstart
var/shuttle_template_id
/// Used to check if the shuttle template is enabled in the config file
var/json_key
///If true, the shuttle can always dock at this docking port, despite its area checks, or if something is already docked
var/override_can_dock_checks = FALSE
/obj/docking_port/stationary/get_save_vars()
return ..() + NAMEOF(src, roundstart_template)
/obj/docking_port/stationary/Initialize(mapload)
. = ..()
register()
@@ -76,18 +81,18 @@
/obj/docking_port/stationary/proc/load_roundstart()
if(json_key)
var/sid = SSmapping.current_map.shuttles[json_key]
roundstart_template = SSmapping.shuttle_templates[sid]
if(!roundstart_template)
shuttle_template_id = SSmapping.shuttle_templates[sid]
if(!shuttle_template_id)
CRASH("json_key:[json_key] value \[[sid]\] resulted in a null shuttle template for [src]")
else if(roundstart_template) // passed a PATH
var/sid = "[initial(roundstart_template.port_id)]_[initial(roundstart_template.suffix)]"
roundstart_template = SSmapping.shuttle_templates[sid]
if(!roundstart_template)
CRASH("Invalid path ([sid]/[roundstart_template]) passed to docking port.")
shuttle_template_id = SSmapping.shuttle_templates[sid]
if(!shuttle_template_id)
CRASH("Invalid path ([sid]/[shuttle_template_id]) passed to docking port.")
if(roundstart_template)
SSshuttle.action_load(roundstart_template, src)
if(shuttle_template_id)
SSshuttle.action_load(shuttle_template_id, src)
//returns first-found touching shuttleport
/obj/docking_port/stationary/get_docked()