[MIRROR] Pulls apart the vestiges of components still hanging onto signals [MDB IGNORE] (#21738)

* Pulls apart the vestiges of components still hanging onto signals

* update modular

---------

Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
Co-authored-by: Tom <8881105+tf-4@users.noreply.github.com>
This commit is contained in:
SkyratBot
2023-06-18 13:18:23 +00:00
committed by GitHub
co-authored by LemonInTheDark Tom
parent da5da42a18
commit 6dfe17306c
373 changed files with 986 additions and 986 deletions
@@ -50,7 +50,7 @@
if(current_variable)
if(should_listen)
current_variable.remove_listener(src)
UnregisterSignal(current_variable, COMSIG_PARENT_QDELETING)
UnregisterSignal(current_variable, COMSIG_QDELETING)
current_variable = null
/obj/item/circuit_component/variable/proc/set_current_variable(datum/circuit_variable/variable)
@@ -61,4 +61,4 @@
current_variable = variable
if(should_listen)
current_variable.add_listener(src)
RegisterSignal(current_variable, COMSIG_PARENT_QDELETING, PROC_REF(remove_current_variable))
RegisterSignal(current_variable, COMSIG_QDELETING, PROC_REF(remove_current_variable))
@@ -78,10 +78,10 @@
/obj/item/circuit_component/mmi/register_shell(atom/movable/shell)
. = ..()
RegisterSignal(shell, COMSIG_PARENT_ATTACKBY, PROC_REF(handle_attack_by))
RegisterSignal(shell, COMSIG_ATOM_ATTACKBY, PROC_REF(handle_attack_by))
/obj/item/circuit_component/mmi/unregister_shell(atom/movable/shell)
UnregisterSignal(shell, COMSIG_PARENT_ATTACKBY)
UnregisterSignal(shell, COMSIG_ATOM_ATTACKBY)
remove_current_brain()
return ..()
@@ -101,7 +101,7 @@
if(to_add.brainmob)
update_mmi_mob(to_add, null, to_add.brainmob)
brain = to_add
RegisterSignal(to_add, COMSIG_PARENT_QDELETING, PROC_REF(remove_current_brain))
RegisterSignal(to_add, COMSIG_QDELETING, PROC_REF(remove_current_brain))
RegisterSignal(to_add, COMSIG_MOVABLE_MOVED, PROC_REF(mmi_moved))
/obj/item/circuit_component/mmi/proc/mmi_moved(atom/movable/mmi)
@@ -118,7 +118,7 @@
if(brain.brainmob)
update_mmi_mob(brain, brain.brainmob)
UnregisterSignal(brain, list(
COMSIG_PARENT_QDELETING,
COMSIG_QDELETING,
COMSIG_MOVABLE_MOVED
))
if(brain.loc == src)
@@ -26,10 +26,10 @@ GLOBAL_LIST_INIT(integrated_circuit_signal_ids, generate_circuit_signal_list())
var/entity = circuit_signal_param("Entity", PORT_TYPE_ATOM)
return list(
COMSIG_PARENT_QDELETING = list(),
COMSIG_PARENT_ATTACKBY = list(circuit_signal_response("Cancel Attack", COMPONENT_NO_AFTERATTACK), item, user),
COMSIG_PARENT_ATTACKBY_SECONDARY = list(circuit_signal_response("Cancel Attack", COMPONENT_NO_AFTERATTACK), item, user),
COMSIG_PARENT_EXAMINE = list(user),
COMSIG_QDELETING = list(),
COMSIG_ATOM_ATTACKBY = list(circuit_signal_response("Cancel Attack", COMPONENT_NO_AFTERATTACK), item, user),
COMSIG_ATOM_ATTACKBY_SECONDARY = list(circuit_signal_response("Cancel Attack", COMPONENT_NO_AFTERATTACK), item, user),
COMSIG_ATOM_EXAMINE = list(user),
COMSIG_ATOM_ATTACK_HAND = list(cancel_attack, user),
COMSIG_ATOM_ATTACK_GHOST = list(cancel_attack, user),
@@ -184,7 +184,7 @@ GLOBAL_LIST_EMPTY_TYPED(integrated_circuits, /obj/item/integrated_circuit)
set_on(TRUE)
SEND_SIGNAL(src, COMSIG_CIRCUIT_SET_SHELL, new_shell)
shell = new_shell
RegisterSignal(shell, COMSIG_PARENT_QDELETING, PROC_REF(remove_current_shell))
RegisterSignal(shell, COMSIG_QDELETING, PROC_REF(remove_current_shell))
for(var/obj/item/circuit_component/attached_component as anything in attached_components)
attached_component.register_shell(shell)
// Their input ports may be updated with user values, but the outputs haven't updated
@@ -201,7 +201,7 @@ GLOBAL_LIST_EMPTY_TYPED(integrated_circuits, /obj/item/integrated_circuit)
shell.name = initial(shell.name)
for(var/obj/item/circuit_component/attached_component as anything in attached_components)
attached_component.unregister_shell(shell)
UnregisterSignal(shell, COMSIG_PARENT_QDELETING)
UnregisterSignal(shell, COMSIG_QDELETING)
shell = null
set_on(FALSE)
SEND_SIGNAL(src, COMSIG_CIRCUIT_SHELL_REMOVED)
+2 -2
View File
@@ -34,7 +34,7 @@
say("Marked [target].")
marked_atom = target
RegisterSignal(marked_atom, COMSIG_PARENT_QDELETING, PROC_REF(cleanup_marked_atom))
RegisterSignal(marked_atom, COMSIG_QDELETING, PROC_REF(cleanup_marked_atom))
update_icon()
flick("multitool_circuit_flick", src)
playsound(src.loc, 'sound/misc/compiler-stage2.ogg', 30, TRUE)
@@ -50,7 +50,7 @@
/obj/item/multitool/circuit/proc/clear_marked_atom()
if(!marked_atom)
return
UnregisterSignal(marked_atom, COMSIG_PARENT_QDELETING)
UnregisterSignal(marked_atom, COMSIG_QDELETING)
marked_atom = null
update_icon()
+3 -3
View File
@@ -52,13 +52,13 @@
if(src.value != value || force)
if(isdatum(src.value))
UnregisterSignal(src.value, COMSIG_PARENT_QDELETING)
UnregisterSignal(src.value, COMSIG_QDELETING)
if(datatype_handler.is_extensive)
src.value = datatype_handler.convert_value_extensive(src, value, force)
else
src.value = datatype_handler.convert_value(src, value, force)
if(isdatum(value))
RegisterSignal(value, COMSIG_PARENT_QDELETING, PROC_REF(null_value))
RegisterSignal(value, COMSIG_QDELETING, PROC_REF(null_value))
SEND_SIGNAL(src, COMSIG_PORT_SET_VALUE, value)
/**
@@ -152,7 +152,7 @@
if(value == source)
value = null
else
stack_trace("Impossible? [src] should only receive COMSIG_PARENT_QDELETING from an atom currently in the port, not [source].")
stack_trace("Impossible? [src] should only receive COMSIG_QDELETING from an atom currently in the port, not [source].")
/**
* # Input Port
+2 -2
View File
@@ -88,13 +88,13 @@
/obj/item/usb_cable/proc/register_circuit_signals()
RegisterSignal(attached_circuit, COMSIG_MOVABLE_MOVED, PROC_REF(on_moved))
RegisterSignal(attached_circuit, COMSIG_PARENT_QDELETING, PROC_REF(on_circuit_qdeling))
RegisterSignal(attached_circuit, COMSIG_QDELETING, PROC_REF(on_circuit_qdeling))
RegisterSignal(attached_circuit.shell, COMSIG_MOVABLE_MOVED, PROC_REF(on_moved))
/obj/item/usb_cable/proc/unregister_circuit_signals(obj/item/integrated_circuit/old_circuit)
UnregisterSignal(attached_circuit, list(
COMSIG_MOVABLE_MOVED,
COMSIG_PARENT_QDELETING,
COMSIG_QDELETING,
))
UnregisterSignal(attached_circuit.shell, COMSIG_MOVABLE_MOVED)
+2 -2
View File
@@ -45,9 +45,9 @@
/// Adds a listener to receive inputs when the variable has a value that is set.
/datum/circuit_variable/proc/add_listener(obj/item/circuit_component/to_add)
listeners += to_add
RegisterSignal(to_add, COMSIG_PARENT_QDELETING, PROC_REF(on_listener_qdel))
RegisterSignal(to_add, COMSIG_QDELETING, PROC_REF(on_listener_qdel))
/// Removes a listener to receive inputs when the variable has a value that is set. Listener will usually clean themselves up
/datum/circuit_variable/proc/remove_listener(obj/item/circuit_component/to_remove)
UnregisterSignal(to_remove, COMSIG_PARENT_QDELETING)
UnregisterSignal(to_remove, COMSIG_QDELETING)
listeners -= to_remove
@@ -183,7 +183,7 @@
user_port.set_output(owner)
user = WEAKREF(owner)
RegisterSignal(owner, COMSIG_PARENT_EXAMINE, PROC_REF(on_examine))
RegisterSignal(owner, COMSIG_ATOM_EXAMINE, PROC_REF(on_examine))
RegisterSignal(owner, COMSIG_PROCESS_BORGCHARGER_OCCUPANT, PROC_REF(on_borg_charge))
RegisterSignal(owner, COMSIG_LIVING_ELECTROCUTE_ACT, PROC_REF(on_electrocute))
@@ -194,7 +194,7 @@
user = null
UnregisterSignal(owner, list(
COMSIG_PARENT_EXAMINE,
COMSIG_ATOM_EXAMINE,
COMSIG_PROCESS_BORGCHARGER_OCCUPANT,
COMSIG_LIVING_ELECTROCUTE_ACT,
))
+4 -4
View File
@@ -33,7 +33,7 @@
stored_items += to_add
to_add.forceMove(src)
RegisterSignal(to_add, COMSIG_MOVABLE_MOVED, PROC_REF(handle_stored_item_moved))
RegisterSignal(to_add, COMSIG_PARENT_QDELETING, PROC_REF(handle_stored_item_deleted))
RegisterSignal(to_add, COMSIG_QDELETING, PROC_REF(handle_stored_item_deleted))
SEND_SIGNAL(src, COMSIG_DISPENSERBOT_ADD_ITEM, to_add)
/obj/structure/dispenser_bot/proc/handle_stored_item_moved(obj/item/moving_item, atom/location)
@@ -48,7 +48,7 @@
/obj/structure/dispenser_bot/proc/remove_item(obj/item/to_remove)
UnregisterSignal(to_remove, list(
COMSIG_MOVABLE_MOVED,
COMSIG_PARENT_QDELETING,
COMSIG_QDELETING,
))
to_remove.forceMove(drop_location())
stored_items -= to_remove
@@ -148,7 +148,7 @@
/obj/item/circuit_component/dispenser_bot/proc/remove_vendor_component(obj/item/circuit_component/vendor_component/vendor_component)
SIGNAL_HANDLER
UnregisterSignal(vendor_component, list(
COMSIG_PARENT_QDELETING,
COMSIG_QDELETING,
COMSIG_CIRCUIT_COMPONENT_REMOVED,
))
if(!QDELING(vendor_component))
@@ -165,7 +165,7 @@
parent.add_component(vendor_component, user)
vendor_components += vendor_component
RegisterSignals(vendor_component, list(
COMSIG_PARENT_QDELETING,
COMSIG_QDELETING,
COMSIG_CIRCUIT_COMPONENT_REMOVED,
), PROC_REF(remove_vendor_component))
+2 -2
View File
@@ -103,14 +103,14 @@
if(istype(shell, /obj/structure/money_bot))
attached_bot = shell
total_money.set_output(attached_bot.stored_money)
RegisterSignal(shell, COMSIG_PARENT_ATTACKBY, PROC_REF(handle_money_insert))
RegisterSignal(shell, COMSIG_ATOM_ATTACKBY, PROC_REF(handle_money_insert))
RegisterSignal(shell, COMSIG_MONEYBOT_ADD_MONEY, PROC_REF(handle_money_update))
RegisterSignal(parent, COMSIG_CIRCUIT_SET_LOCKED, PROC_REF(on_set_locked))
attached_bot.locked = parent.locked
/obj/item/circuit_component/money_bot/unregister_shell(atom/movable/shell)
UnregisterSignal(shell, list(
COMSIG_PARENT_ATTACKBY,
COMSIG_ATOM_ATTACKBY,
COMSIG_MONEYBOT_ADD_MONEY,
))
total_money.set_output(null)