From 3c8313650fc4ae9d09093fa9386a63d1649de41f Mon Sep 17 00:00:00 2001 From: Anewbe Date: Thu, 30 Aug 2018 22:59:15 -0500 Subject: [PATCH] Might fix the server startup error_handler runtime --- code/datums/observation/helpers.dm | 6 +++--- code/datums/observation/logged_in.dm | 4 ++-- code/datums/observation/moved.dm | 15 ++++++++------- code/datums/observation/unequipped.dm | 8 ++++---- code/modules/holomap/station_holomap.dm | 4 ++-- code/modules/mob/living/bot/secbot.dm | 6 +++--- 6 files changed, 22 insertions(+), 21 deletions(-) diff --git a/code/datums/observation/helpers.dm b/code/datums/observation/helpers.dm index 7857434170..9116026700 100644 --- a/code/datums/observation/helpers.dm +++ b/code/datums/observation/helpers.dm @@ -1,5 +1,5 @@ /atom/movable/proc/recursive_move(var/atom/movable/am, var/old_loc, var/new_loc) - moved_event.raise_event(src, old_loc, new_loc) + GLOB.moved_event.raise_event(src, old_loc, new_loc) /atom/movable/proc/move_to_destination(var/atom/movable/am, var/old_loc, var/new_loc) var/turf/T = get_turf(new_loc) @@ -10,9 +10,9 @@ set_dir(new_dir) /proc/register_all_movement(var/event_source, var/listener) - moved_event.register(event_source, listener, /atom/movable/proc/recursive_move) + GLOB.moved_event.register(event_source, listener, /atom/movable/proc/recursive_move) GLOB.dir_set_event.register(event_source, listener, /atom/proc/recursive_dir_set) /proc/unregister_all_movement(var/event_source, var/listener) - moved_event.unregister(event_source, listener, /atom/movable/proc/recursive_move) + GLOB.moved_event.unregister(event_source, listener, /atom/movable/proc/recursive_move) GLOB.dir_set_event.unregister(event_source, listener, /atom/proc/recursive_dir_set) diff --git a/code/datums/observation/logged_in.dm b/code/datums/observation/logged_in.dm index 311ff8acb6..c59e146a48 100644 --- a/code/datums/observation/logged_in.dm +++ b/code/datums/observation/logged_in.dm @@ -6,7 +6,7 @@ // Arguments that the called proc should expect: // /mob/joiner: The mob that has logged in -var/decl/observ/logged_in/logged_in_event = new() +GLOBAL_DATUM_INIT(logged_in_event, /decl/observ/logged_in, new) /decl/observ/logged_in name = "Logged In" @@ -18,4 +18,4 @@ var/decl/observ/logged_in/logged_in_event = new() /mob/Login() ..() - logged_in_event.raise_event(src) + GLOB.logged_in_event.raise_event(src) diff --git a/code/datums/observation/moved.dm b/code/datums/observation/moved.dm index 86a6b793ac..311f9673f6 100644 --- a/code/datums/observation/moved.dm +++ b/code/datums/observation/moved.dm @@ -8,7 +8,8 @@ // /atom/old_loc: The loc before the move. // /atom/new_loc: The loc after the move. -var/decl/observ/moved/moved_event = new() + +GLOBAL_DATUM_INIT(moved_event, /decl/observ/moved, new) /decl/observ/moved name = "Moved" @@ -27,26 +28,26 @@ var/decl/observ/moved/moved_event = new() /atom/Entered(var/atom/movable/am, var/atom/old_loc) . = ..() - moved_event.raise_event(am, old_loc, am.loc) + GLOB.moved_event.raise_event(am, old_loc, am.loc) /atom/movable/Entered(var/atom/movable/am, atom/old_loc) . = ..() - if(moved_event.has_listeners(am)) - moved_event.register(src, am, /atom/movable/proc/recursive_move) + if(GLOB.moved_event.has_listeners(am)) + GLOB.moved_event.register(src, am, /atom/movable/proc/recursive_move) /atom/movable/Exited(var/atom/movable/am, atom/old_loc) . = ..() - moved_event.unregister(src, am, /atom/movable/proc/recursive_move) + GLOB.moved_event.unregister(src, am, /atom/movable/proc/recursive_move) // Entered() typically lifts the moved event, but in the case of null-space we'll have to handle it. /atom/movable/Move() var/old_loc = loc . = ..() if(. && !loc) - moved_event.raise_event(src, old_loc, null) + GLOB.moved_event.raise_event(src, old_loc, null) /atom/movable/forceMove(atom/destination) var/old_loc = loc . = ..() if(. && !loc) - moved_event.raise_event(src, old_loc, null) + GLOB.moved_event.raise_event(src, old_loc, null) diff --git a/code/datums/observation/unequipped.dm b/code/datums/observation/unequipped.dm index 3287c0a3b5..6ad8d8eca0 100644 --- a/code/datums/observation/unequipped.dm +++ b/code/datums/observation/unequipped.dm @@ -7,7 +7,7 @@ // /mob/equipped: The mob that unequipped/dropped the item. // /obj/item/item: The unequipped item. -var/decl/observ/mob_unequipped/mob_unequipped_event = new() +GLOBAL_DATUM_INIT(mob_unequipped_event, /decl/observ/mob_unequipped, new) /decl/observ/mob_unequipped name = "Mob Unequipped" @@ -22,7 +22,7 @@ var/decl/observ/mob_unequipped/mob_unequipped_event = new() // /obj/item/item: The unequipped item. // /mob/equipped: The mob that unequipped/dropped the item. -var/decl/observ/item_unequipped/item_unequipped_event = new() +GLOBAL_DATUM_INIT(item_unequipped_event, /decl/observ/item_unequipped, new) /decl/observ/item_unequipped name = "Item Unequipped" @@ -34,5 +34,5 @@ var/decl/observ/item_unequipped/item_unequipped_event = new() /obj/item/dropped(var/mob/user) ..() - mob_unequipped_event.raise_event(user, src) - item_unequipped_event.raise_event(src, user) + GLOB.mob_unequipped_event.raise_event(user, src) + GLOB.item_unequipped_event.raise_event(src, user) diff --git a/code/modules/holomap/station_holomap.dm b/code/modules/holomap/station_holomap.dm index c30beb2413..b47c154b65 100644 --- a/code/modules/holomap/station_holomap.dm +++ b/code/modules/holomap/station_holomap.dm @@ -123,7 +123,7 @@ user.client.images |= holomap_datum.station_map watching_mob = user - moved_event.register(watching_mob, src, /obj/machinery/station_map/proc/checkPosition) + GLOB.moved_event.register(watching_mob, src, /obj/machinery/station_map/proc/checkPosition) GLOB.dir_set_event.register(watching_mob, src, /obj/machinery/station_map/proc/checkPosition) destroyed_event.register(watching_mob, src, /obj/machinery/station_map/proc/stopWatching) update_use_power(2) @@ -152,7 +152,7 @@ var/mob/M = watching_mob spawn(5) //we give it time to fade out M.client.images -= holomap_datum.station_map - moved_event.unregister(watching_mob, src) + GLOB.moved_event.unregister(watching_mob, src) GLOB.dir_set_event.unregister(watching_mob, src) destroyed_event.unregister(watching_mob, src) watching_mob = null diff --git a/code/modules/mob/living/bot/secbot.dm b/code/modules/mob/living/bot/secbot.dm index 81e71eafb1..9640cab0c2 100644 --- a/code/modules/mob/living/bot/secbot.dm +++ b/code/modules/mob/living/bot/secbot.dm @@ -159,17 +159,17 @@ say("Down on the floor, [suspect_name]! You have [SECBOT_WAIT_TIME] seconds to comply.") playsound(src.loc, pick(preparing_arrest_sounds), 50) // Register to be told when the target moves - moved_event.register(target, src, /mob/living/bot/secbot/proc/target_moved) + GLOB.moved_event.register(target, src, /mob/living/bot/secbot/proc/target_moved) // Callback invoked if the registered target moves /mob/living/bot/secbot/proc/target_moved(atom/movable/moving_instance, atom/old_loc, atom/new_loc) if(get_dist(get_turf(src), get_turf(target)) >= 1) awaiting_surrender = INFINITY // Done waiting! - moved_event.unregister(moving_instance, src) + GLOB.moved_event.unregister(moving_instance, src) /mob/living/bot/secbot/resetTarget() ..() - moved_event.unregister(target, src) + GLOB.moved_event.unregister(target, src) awaiting_surrender = -1 walk_to(src, 0)