Partially ports the GLOB system

This commit is contained in:
Anewbe
2018-08-14 18:14:09 -05:00
parent 2eafa13c96
commit eebb627f00
74 changed files with 448 additions and 154 deletions

View File

@@ -8,7 +8,7 @@
// /old_dir: The dir before the change.
// /new_dir: The dir after the change.
var/decl/observ/dir_set/dir_set_event = new()
GLOBAL_DATUM_INIT(dir_set_event, /decl/observ/dir_set, new)
/decl/observ/dir_set
name = "Direction Set"
@@ -27,9 +27,9 @@ var/decl/observ/dir_set/dir_set_event = new()
/atom/movable/Entered(var/atom/movable/am, atom/old_loc)
. = ..()
if(. != CANCEL_MOVE_EVENT && dir_set_event.has_listeners(am))
dir_set_event.register(src, am, /atom/proc/recursive_dir_set)
if(. != CANCEL_MOVE_EVENT && GLOB.dir_set_event.has_listeners(am))
GLOB.dir_set_event.register(src, am, /atom/proc/recursive_dir_set)
/atom/movable/Exited(var/atom/movable/am, atom/old_loc)
. = ..()
dir_set_event.unregister(src, am, /atom/proc/recursive_dir_set)
GLOB.dir_set_event.unregister(src, am, /atom/proc/recursive_dir_set)