diff --git a/code/__defines/dcs/helpers.dm b/code/__defines/dcs/helpers.dm index c3f73cec123..df6acffd761 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 2d543c172dd..03a213baaaf 100644 --- a/code/controllers/subsystems/statpanel.dm +++ b/code/controllers/subsystems/statpanel.dm @@ -451,9 +451,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 6a3a8e91ea5..a74dbfd7d43 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 1b252e4f9b7..00ec3931e86 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/game/machinery/camera/motion.dm b/code/game/machinery/camera/motion.dm index f07c23001b8..a4486af8ea3 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 c80addd1b5e..5880c713bd8 100644 --- a/code/game/machinery/doors/windowdoor.dm +++ b/code/game/machinery/doors/windowdoor.dm @@ -112,8 +112,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() @@ -134,8 +137,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 31a2c961f19..489ec79a017 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 dd9ca798150..1354a8f322b 100644 --- a/code/game/objects/items/devices/radio/intercom.dm +++ b/code/game/objects/items/devices/radio/intercom.dm @@ -20,7 +20,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 3d6e979dfc7..91550634c6c 100644 --- a/code/game/objects/items/devices/transfer_valve.dm +++ b/code/game/objects/items/devices/transfer_valve.dm @@ -57,7 +57,6 @@ /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 8adbe4e3c49..f728ce597b8 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 6b47c530b04..54fd14817df 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 2104b26164d..fb2ee2359cf 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 f7476a07d10..bb8fd7187f0 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 4a26c5787da..16089358e86 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 c0b4832efe5..02f2414a992 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 6447629ba13..976bee42cbd 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 920cbe16cd8..7680c319879 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 58116da3af2..09defd2d1a0 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 b1b1eaffd2c..2c3b439fb7d 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 fdecef225b4..f905d9072c5 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 27d617a18e4..f5b147da7c5 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 24aa226d182..416d5050336 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