mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-07-21 21:10:30 +01: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:
@@ -104,7 +104,6 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
GLOB.destroyed_event.raise_event(src)
|
||||
if (!isturf(src))
|
||||
cleanup_events(src)
|
||||
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
GLOBAL_DATUM_INIT(destroyed_event, /singleton/observ/destroyed, new)
|
||||
|
||||
/singleton/observ/destroyed
|
||||
name = "Destroyed"
|
||||
@@ -114,7 +114,7 @@ GLOBAL_DATUM_INIT(sound_player, /singleton/sound_player, new)
|
||||
listeners = list()
|
||||
listener_status = list()
|
||||
|
||||
GLOB.destroyed_event.register(source, src, /datum/proc/qdel_self)
|
||||
RegisterSignal(source, COMSIG_QDELETING, TYPE_PROC_REF(/datum, qdel_self))
|
||||
|
||||
PrivLocateListeners()
|
||||
START_PROCESSING(SSprocessing, src)
|
||||
@@ -154,7 +154,7 @@ GLOBAL_DATUM_INIT(sound_player, /singleton/sound_player, new)
|
||||
listeners = null
|
||||
listener_status = null
|
||||
|
||||
GLOB.destroyed_event.unregister(source, src, /datum/proc/qdel_self)
|
||||
UnregisterSignal(source, COMSIG_QDELETING)
|
||||
source = null
|
||||
|
||||
GLOB.sound_player.PrivStopSound(src)
|
||||
@@ -198,7 +198,7 @@ GLOBAL_DATUM_INIT(sound_player, /singleton/sound_player, new)
|
||||
listeners += listener
|
||||
|
||||
RegisterSignal(listener, COMSIG_MOVABLE_MOVED, PROC_REF(PrivUpdateListenerLoc))
|
||||
GLOB.destroyed_event.register(listener, src, PROC_REF(PrivRemoveListener))
|
||||
RegisterSignal(listener, COMSIG_QDELETING, PROC_REF(PrivRemoveListener))
|
||||
|
||||
PrivUpdateListenerLoc(listener, update_sound = FALSE)
|
||||
|
||||
@@ -206,7 +206,7 @@ GLOBAL_DATUM_INIT(sound_player, /singleton/sound_player, new)
|
||||
null_sound = null_sound || new(channel = sound.channel)
|
||||
sound_to(listener, null_sound)
|
||||
UnregisterSignal(listener, COMSIG_MOVABLE_MOVED)
|
||||
GLOB.destroyed_event.unregister(listener, src, PROC_REF(PrivRemoveListener))
|
||||
UnregisterSignal(listener, COMSIG_QDELETING)
|
||||
listeners -= listener
|
||||
|
||||
/datum/sound_token/proc/PrivUpdateListenerLoc(atom/movable/listener, atom/old_loc, dir, forced, list/old_locs, update_sound = TRUE)
|
||||
|
||||
Reference in New Issue
Block a user