mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-28 10:31:59 +00:00
[MIRROR] Fixes loading shells with their own initial circuits [MDB IGNORE] (#10293)
* save shell component properly loads shells that come with their own circuit (#63628) Attempting to load a BCI or circuit MODsuit module with the save shell component yields an empty circuit. This PR fixes that by making the save shell component check for and delete any pre-existing circuit in the loaded shell. * Fixes loading shells with their own initial circuits Co-authored-by: Y0SH1M4S73R <legoboyo@earthlink.net>
This commit is contained in:
@@ -28,7 +28,12 @@
|
||||
|
||||
/obj/item/circuit_component/save_shell/proc/on_post_load(datum/source)
|
||||
SIGNAL_HANDLER
|
||||
loaded_shell.AddComponent(/datum/component/shell, starting_circuit = parent)
|
||||
var/datum/component/shell/shell_component = loaded_shell.GetComponent(/datum/component/shell)
|
||||
if(!istype(shell_component))
|
||||
loaded_shell.AddComponent(/datum/component/shell, starting_circuit = parent)
|
||||
else
|
||||
QDEL_NULL(shell_component.attached_circuit)
|
||||
shell_component.attach_circuit(parent)
|
||||
on_loaded.set_output(COMPONENT_SIGNAL)
|
||||
|
||||
/obj/item/circuit_component/save_shell/proc/on_pre_save_to_json(datum/source, list/general_data)
|
||||
|
||||
Reference in New Issue
Block a user