diff --git a/code/__defines/dcs/helpers.dm b/code/__defines/dcs/helpers.dm index c3f73cec12..df6acffd76 100644 --- a/code/__defines/dcs/helpers.dm +++ b/code/__defines/dcs/helpers.dm @@ -8,8 +8,7 @@ /// Signifies that this proc is used to handle signals. /// Every proc you pass to RegisterSignal must have this. -// #define SIGNAL_HANDLER SHOULD_NOT_SLEEP(TRUE) FIXME: FIXME: Causing some big issues still -#define SIGNAL_HANDLER +#define SIGNAL_HANDLER SHOULD_NOT_SLEEP(TRUE) /// A wrapper for _AddElement that allows us to pretend we're using normal named arguments #define AddElement(arguments...) _AddElement(list(##arguments)) diff --git a/code/controllers/subsystems/statpanel.dm b/code/controllers/subsystems/statpanel.dm index d1eaa55a93..e365fb1585 100644 --- a/code/controllers/subsystems/statpanel.dm +++ b/code/controllers/subsystems/statpanel.dm @@ -454,9 +454,9 @@ SUBSYSTEM_DEF(statpanels) on_mob_move(parent.mob) /datum/object_window_info/proc/turflist_changed(mob/source) + SIGNAL_HANDLER if(!parent)//statbrowser hasnt fired yet and we still have a pending action return - SIGNAL_HANDLER if(!(flags & TURFLIST_UPDATED)) //Limit updates to 1 per tick SSstatpanels.immediate_send_stat_data(parent) flags |= TURFLIST_UPDATED diff --git a/code/datums/components/orbiter.dm b/code/datums/components/orbiter.dm index 6a3a8e91ea..a74dbfd7d4 100644 --- a/code/datums/components/orbiter.dm +++ b/code/datums/components/orbiter.dm @@ -135,7 +135,7 @@ if(QDELETED(thing) || thing.loc == newturf) continue thing.forceMove(newturf, movetime = MOVE_GLIDE_CALC(glide_size,0)) - if(CHECK_TICK && master.loc != curloc) + if(TICK_CHECK && master.loc != curloc) // We moved again during the checktick, cancel current operation break diff --git a/code/datums/components/traits/gargoyle.dm b/code/datums/components/traits/gargoyle.dm index 1b252e4f9b..00ec3931e8 100644 --- a/code/datums/components/traits/gargoyle.dm +++ b/code/datums/components/traits/gargoyle.dm @@ -53,6 +53,7 @@ . = ..() /datum/component/gargoyle/proc/unpause() + SIGNAL_HANDLER if (!paused || transformed) paused = FALSE paused_loc = null diff --git a/code/datums/proximity_monitor/proximity_monitor_ch.dm b/code/datums/proximity_monitor/proximity_monitor_ch.dm index ab69757e7a..22b913d925 100644 --- a/code/datums/proximity_monitor/proximity_monitor_ch.dm +++ b/code/datums/proximity_monitor/proximity_monitor_ch.dm @@ -86,12 +86,10 @@ /datum/proximity_monitor/mobspawner /datum/proximity_monitor/mobspawner/on_uncrossed(atom/source, atom/movable/AM, atom/new_loc) - SIGNAL_HANDLER var/obj/structure/mob_spawner/scanner/scanner = host scanner.CheckProximity(AM,new_loc) /datum/proximity_monitor/mobspawner/on_entered(atom/source, atom/movable/arrived) - SIGNAL_HANDLER var/obj/structure/mob_spawner/scanner/scanner = host if(source != host) scanner.NewProximity(arrived) diff --git a/code/game/machinery/camera/motion.dm b/code/game/machinery/camera/motion.dm index b307498392..bfa70266af 100644 --- a/code/game/machinery/camera/motion.dm +++ b/code/game/machinery/camera/motion.dm @@ -55,7 +55,6 @@ return 1 /obj/machinery/camera/HasProximity(turf/T, datum/weakref/WF, old_loc) - SIGNAL_HANDLER if(isnull(WF)) return var/atom/movable/AM = WF.resolve() diff --git a/code/game/machinery/doors/windowdoor.dm b/code/game/machinery/doors/windowdoor.dm index 496720b9ef..35be066cb9 100644 --- a/code/game/machinery/doors/windowdoor.dm +++ b/code/game/machinery/doors/windowdoor.dm @@ -119,8 +119,11 @@ operating = 1 flick(text("[src.base_state]opening"), src) playsound(src, 'sound/machines/door/windowdoor.ogg', 100, 1) - sleep(10) + addtimer(CALLBACK(src, PROC_REF(finish_open)), 1 SECONDS, TIMER_DELETE_ME) +/obj/machinery/door/window/proc/finish_open() + PRIVATE_PROC(TRUE) + SHOULD_NOT_OVERRIDE(TRUE) explosion_resistance = 0 density = FALSE update_icon() @@ -141,8 +144,11 @@ update_icon() explosion_resistance = initial(explosion_resistance) update_nearby_tiles() + addtimer(CALLBACK(src, PROC_REF(finish_close)), 1 SECONDS, TIMER_DELETE_ME) - sleep(10) +/obj/machinery/door/window/proc/finish_close() + PRIVATE_PROC(TRUE) + SHOULD_NOT_OVERRIDE(TRUE) operating = FALSE return TRUE diff --git a/code/game/machinery/flasher.dm b/code/game/machinery/flasher.dm index dd88ad93dc..bcfdcd1621 100644 --- a/code/game/machinery/flasher.dm +++ b/code/game/machinery/flasher.dm @@ -98,7 +98,6 @@ ..(severity) /obj/machinery/flasher/portable/HasProximity(turf/T, datum/weakref/WF, oldloc) - SIGNAL_HANDLER if(isnull(WF)) return diff --git a/code/game/objects/items/devices/radio/intercom.dm b/code/game/objects/items/devices/radio/intercom.dm index 1052dbe93f..60c166ff6e 100644 --- a/code/game/objects/items/devices/radio/intercom.dm +++ b/code/game/objects/items/devices/radio/intercom.dm @@ -21,7 +21,11 @@ . = ..() var/area/A = get_area(src) if(A) - RegisterSignal(A, COMSIG_OBSERVER_APC, /atom/proc/update_icon) + RegisterSignal(A, COMSIG_OBSERVER_APC, PROC_REF(on_observer_apc)) + update_icon() + +/obj/item/radio/intercom/proc/on_observer_apc() + SIGNAL_HANDLER update_icon() /obj/item/radio/intercom/Destroy() diff --git a/code/game/objects/items/devices/transfer_valve.dm b/code/game/objects/items/devices/transfer_valve.dm index 8c6035fbc7..1d7e3a3810 100644 --- a/code/game/objects/items/devices/transfer_valve.dm +++ b/code/game/objects/items/devices/transfer_valve.dm @@ -56,7 +56,6 @@ return /obj/item/transfer_valve/HasProximity(turf/T, datum/weakref/WF, old_loc) - SIGNAL_HANDLER if(isnull(WF)) return var/atom/movable/AM = WF.resolve() diff --git a/code/game/objects/items/weapons/storage/bags.dm b/code/game/objects/items/weapons/storage/bags.dm index 6fef9a4551..a44997f8a1 100644 --- a/code/game/objects/items/weapons/storage/bags.dm +++ b/code/game/objects/items/weapons/storage/bags.dm @@ -215,6 +215,7 @@ UnregisterSignal(user, COMSIG_OBSERVER_MOVED) /obj/item/storage/bag/ore/proc/autoload(mob/user) + SIGNAL_HANDLER var/obj/item/ore/O = locate() in get_turf(src) if(O) gather_all(get_turf(src), user) diff --git a/code/game/objects/items/weapons/tanks/tanks.dm b/code/game/objects/items/weapons/tanks/tanks.dm index 6b47c530b0..54fd14817d 100644 --- a/code/game/objects/items/weapons/tanks/tanks.dm +++ b/code/game/objects/items/weapons/tanks/tanks.dm @@ -658,7 +658,6 @@ var/list/global/tank_gauge_cache = list() tank.cut_overlay("bomb_assembly") /obj/item/tankassemblyproxy/HasProximity(turf/T, datum/weakref/WF, old_loc) - SIGNAL_HANDLER if(isnull(WF)) return var/atom/movable/AM = WF.resolve() diff --git a/code/modules/assembly/holder.dm b/code/modules/assembly/holder.dm index 2104b26164..fb2ee2359c 100644 --- a/code/modules/assembly/holder.dm +++ b/code/modules/assembly/holder.dm @@ -71,7 +71,6 @@ sense_proximity(callback = TYPE_PROC_REF(/atom,HasProximity)) /obj/item/assembly_holder/HasProximity(turf/T, datum/weakref/WF, old_loc) - SIGNAL_HANDLER if(isnull(WF)) return var/atom/movable/AM = WF.resolve() diff --git a/code/modules/assembly/proximity.dm b/code/modules/assembly/proximity.dm index b713b4ec1c..9abb889371 100644 --- a/code/modules/assembly/proximity.dm +++ b/code/modules/assembly/proximity.dm @@ -33,7 +33,6 @@ return secured /obj/item/assembly/prox_sensor/HasProximity(turf/T, datum/weakref/WF, old_loc) - SIGNAL_HANDLER if(isnull(WF)) return var/atom/movable/AM = WF.resolve() diff --git a/code/modules/blob2/core_chunk.dm b/code/modules/blob2/core_chunk.dm index 4a26c5787d..16089358e8 100644 --- a/code/modules/blob2/core_chunk.dm +++ b/code/modules/blob2/core_chunk.dm @@ -62,6 +62,7 @@ START_PROCESSING(SSobj, src) /obj/item/blobcore_chunk/proc/call_chunk_unique() + SIGNAL_HANDLER if(blob_type) blob_type.chunk_unique(src, args) return diff --git a/code/modules/clothing/spacesuits/rig/modules/specific/pat_module_vr.dm b/code/modules/clothing/spacesuits/rig/modules/specific/pat_module_vr.dm index c0b4832efe..02f2414a99 100644 --- a/code/modules/clothing/spacesuits/rig/modules/specific/pat_module_vr.dm +++ b/code/modules/clothing/spacesuits/rig/modules/specific/pat_module_vr.dm @@ -50,6 +50,7 @@ UnregisterSignal(H, COMSIG_OBSERVER_MOVED) /obj/item/rig_module/pat_module/proc/boop(var/mob/living/carbon/human/user,var/turf/To,var/turf/Tn) + SIGNAL_HANDLER if(!istype(user) || !istype(To) || !istype(Tn)) deactivate() //They were picked up or something, or put themselves in a locker, who knows. Just turn off. return diff --git a/code/modules/hydroponics/grown.dm b/code/modules/hydroponics/grown.dm index 6447629ba1..976bee42cb 100644 --- a/code/modules/hydroponics/grown.dm +++ b/code/modules/hydroponics/grown.dm @@ -162,8 +162,7 @@ M.Stun(8) M.Weaken(5) seed.thrown_at(src,M) - sleep(-1) - if(src) qdel(src) + qdel(src) return /obj/item/reagent_containers/food/snacks/grown/throw_impact(atom/hit_atom) diff --git a/code/modules/hydroponics/spreading/spreading_response.dm b/code/modules/hydroponics/spreading/spreading_response.dm index afa1b273d2..33ae116a98 100644 --- a/code/modules/hydroponics/spreading/spreading_response.dm +++ b/code/modules/hydroponics/spreading/spreading_response.dm @@ -1,5 +1,4 @@ /obj/effect/plant/HasProximity(turf/T, datum/weakref/WF, old_loc) - SIGNAL_HANDLER if(isnull(WF)) return var/atom/movable/AM = WF.resolve() diff --git a/code/modules/power/singularity/containment_field.dm b/code/modules/power/singularity/containment_field.dm index 58116da3af..09defd2d1a 100644 --- a/code/modules/power/singularity/containment_field.dm +++ b/code/modules/power/singularity/containment_field.dm @@ -53,7 +53,6 @@ shock(L) /obj/machinery/containment_field/HasProximity(turf/T, datum/weakref/WF, old_loc) - SIGNAL_HANDLER if(isnull(WF)) return var/atom/movable/AM = WF.resolve() @@ -83,9 +82,7 @@ var/atom/target = get_edge_target_turf(user, get_dir(src, get_step_away(user, src))) user.throw_at(target, 200, 4) - sleep(20) - - hasShocked = 0 + VARSET_IN(src, hasShocked, FALSE, 2 SECONDS) /obj/machinery/containment_field/proc/set_master(var/master1,var/master2) if(!master1 || !master2) diff --git a/code/modules/tgui/modules/appearance_changer.dm b/code/modules/tgui/modules/appearance_changer.dm index b1b1eaffd2..2c3b439fb7 100644 --- a/code/modules/tgui/modules/appearance_changer.dm +++ b/code/modules/tgui/modules/appearance_changer.dm @@ -1000,7 +1000,6 @@ return ..() /datum/tgui_module/appearance_changer/vore/update_active_camera_screen() - SIGNAL_HANDLER cam_screen.vis_contents = list(owner) cam_background.icon_state = "clear" cam_background.fill_rect(1, 1, 1, 1) diff --git a/code/unit_tests/clothing_tests.dm b/code/unit_tests/clothing_tests.dm index fdecef225b..f905d9072c 100644 --- a/code/unit_tests/clothing_tests.dm +++ b/code/unit_tests/clothing_tests.dm @@ -149,7 +149,6 @@ return failed /datum/unit_test/all_clothing_shall_be_valid/get_signal_data(atom/source, list/data = list()) - SIGNAL_HANDLER switch(data[1]) if("set_slot") var/slot_name = data[2] diff --git a/code/unit_tests/reagent_tests.dm b/code/unit_tests/reagent_tests.dm index 27d617a18e..f5b147da7c 100644 --- a/code/unit_tests/reagent_tests.dm +++ b/code/unit_tests/reagent_tests.dm @@ -280,7 +280,6 @@ return TRUE /datum/unit_test/chemical_reactions_shall_not_conflict/get_signal_data(atom/source, list/data = list()) - SIGNAL_HANDLER result_reactions.Add(data[1]) // Append the reactions that happened, then use that to check their inhibitors diff --git a/code/unit_tests/unit_test.dm b/code/unit_tests/unit_test.dm index 24aa226d18..416d505033 100644 --- a/code/unit_tests/unit_test.dm +++ b/code/unit_tests/unit_test.dm @@ -111,3 +111,4 @@ var/total_unit_tests = 0 // This signal should never be possible to call if the game is not compiled for unit tests /datum/unit_test/proc/get_signal_data(atom/source, list/data = list()) SIGNAL_HANDLER + return diff --git a/modular_chomp/code/game/machinery/bluespace_denier.dm b/modular_chomp/code/game/machinery/bluespace_denier.dm index 8402a92d5f..8a5f81b2af 100644 --- a/modular_chomp/code/game/machinery/bluespace_denier.dm +++ b/modular_chomp/code/game/machinery/bluespace_denier.dm @@ -74,7 +74,6 @@ ..(severity) /obj/machinery/bluespace_denier/HasProximity(turf/T, datum/weakref/WF, oldloc) - SIGNAL_HANDLER if(isnull(WF)) return