mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-07-18 03:21:13 +01:00
Fix several hard-dels, add harddel ref tracking (#16174)
This commit is contained in:
@@ -17,6 +17,10 @@
|
||||
/// Is this datum capable of sending signals?
|
||||
/// Set to true when a signal has been registered
|
||||
var/signal_enabled = FALSE
|
||||
/// A cached version of our \ref
|
||||
/// The brunt of \ref costs are in creating entries in the string tree (a tree of immutable strings)
|
||||
/// This avoids doing that more then once per datum by ensuring ref strings always have a reference to them after they're first pulled
|
||||
var/cached_ref
|
||||
|
||||
// Default implementation of clean-up code.
|
||||
// This should be overridden to remove all references pointing to the object being destroyed.
|
||||
|
||||
@@ -14,6 +14,14 @@ var/singleton/observ/moved/moved_event = new()
|
||||
child = parent
|
||||
parent = child.loc
|
||||
|
||||
/singleton/observ/moved/proc/register_all_movement(var/event_source, var/listener)
|
||||
moved_event.register(event_source, listener, /atom/movable/proc/recursive_move)
|
||||
dir_set_event.register(event_source, listener, /atom/proc/recursive_dir_set)
|
||||
|
||||
/singleton/observ/moved/proc/unregister_all_movement(var/event_source, var/listener)
|
||||
moved_event.unregister(event_source, listener, /atom/movable/proc/recursive_move)
|
||||
dir_set_event.unregister(event_source, listener, /atom/proc/recursive_dir_set)
|
||||
|
||||
/********************
|
||||
* Movement Handling *
|
||||
********************/
|
||||
@@ -24,7 +32,7 @@ var/singleton/observ/moved/moved_event = new()
|
||||
forceMove(T)
|
||||
|
||||
/atom/movable/proc/recursive_move(var/atom/movable/am, var/old_loc, var/new_loc)
|
||||
moved_event.raise_event(list(src, old_loc, new_loc))
|
||||
moved_event.raise_event(src, old_loc, new_loc)
|
||||
|
||||
/atom/Entered(var/atom/movable/am, atom/old_loc)
|
||||
..()
|
||||
|
||||
@@ -114,7 +114,7 @@ var/singleton/sound_player/sound_player = new()
|
||||
listeners = list()
|
||||
listener_status = list()
|
||||
|
||||
destroyed_event.register(source, src, TYPE_PROC_REF(/datum/, qdel))
|
||||
destroyed_event.register(source, src, TYPE_PROC_REF(/datum, qdel_self))
|
||||
|
||||
PrivLocateListeners()
|
||||
START_PROCESSING(SSprocessing, src)
|
||||
@@ -260,4 +260,4 @@ var/singleton/sound_player/sound_player = new()
|
||||
return TRUE
|
||||
|
||||
/datum/sound_token/static_environment/PrivGetEnvironment()
|
||||
return sound.environment
|
||||
return sound.environment
|
||||
|
||||
Reference in New Issue
Block a user