mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-01-16 12:22:42 +00:00
Refactored deletion observables to use the COMSIG_QDELETING signal (#20121)
Refactored deletion observables to use the COMSIG_QDELETING signal instead, removed the observable.
This commit is contained in:
@@ -69,13 +69,13 @@
|
||||
return
|
||||
ClearValue()
|
||||
value_to_set = new_value
|
||||
GLOB.destroyed_event.register(value_to_set, src, /datum/build_mode/edit/proc/ClearValue)
|
||||
RegisterSignal(value_to_set, COMSIG_QDELETING, /datum/build_mode/edit/proc/ClearValue)
|
||||
|
||||
/datum/build_mode/edit/proc/ClearValue(var/feedback)
|
||||
if(!istype(value_to_set, /datum))
|
||||
return
|
||||
|
||||
GLOB.destroyed_event.unregister(value_to_set, src, /datum/build_mode/edit/proc/ClearValue)
|
||||
UnregisterSignal(value_to_set, COMSIG_QDELETING)
|
||||
value_to_set = initial(value_to_set)
|
||||
if(feedback)
|
||||
Warn("The selected reference value was deleted. Default value restored.")
|
||||
|
||||
@@ -33,14 +33,14 @@
|
||||
ClearDestination()
|
||||
|
||||
destination = A
|
||||
GLOB.destroyed_event.register(destination, src, /datum/build_mode/move_into/proc/ClearDestination)
|
||||
RegisterSignal(destination, COMSIG_QDELETING, /datum/build_mode/move_into/proc/ClearDestination)
|
||||
to_chat(user, SPAN_NOTICE("Will now move targets into \the [destination]."))
|
||||
|
||||
/datum/build_mode/move_into/proc/ClearDestination(var/feedback)
|
||||
if(!destination)
|
||||
return
|
||||
|
||||
GLOB.destroyed_event.unregister(destination, src, /datum/build_mode/move_into/proc/ClearDestination)
|
||||
UnregisterSignal(destination, COMSIG_QDELETING)
|
||||
destination = null
|
||||
if(feedback)
|
||||
Warn("The selected destination was deleted.")
|
||||
|
||||
Reference in New Issue
Block a user