mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-27 23:27:34 +01:00
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:     ## 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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user