From 671f289e18fcec42bfc4fe0cb23dc473871b851e Mon Sep 17 00:00:00 2001 From: Farie82 Date: Mon, 24 Jan 2022 14:40:08 +0100 Subject: [PATCH] Fixes a runtime when you remove a fax too fast when sending it (#17360) --- code/modules/paperwork/faxmachine.dm | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/code/modules/paperwork/faxmachine.dm b/code/modules/paperwork/faxmachine.dm index 0a427b2a50a..8d0862285f9 100644 --- a/code/modules/paperwork/faxmachine.dm +++ b/code/modules/paperwork/faxmachine.dm @@ -315,10 +315,10 @@ GLOBAL_LIST_EMPTY(fax_blacklist) flick(receive_anim, src) playsound(loc, 'sound/goonstation/machines/printer_dotmatrix.ogg', 50, 1) + addtimer(CALLBACK(src, .proc/print_fax, incoming), 2 SECONDS) + return TRUE - // give the sprite some time to flick - sleep(20) - +/obj/machinery/photocopier/faxmachine/proc/print_fax(obj/item/incoming) if(istype(incoming, /obj/item/paper)) papercopy(incoming) else if(istype(incoming, /obj/item/photo)) @@ -326,10 +326,9 @@ GLOBAL_LIST_EMPTY(fax_blacklist) else if(istype(incoming, /obj/item/paper_bundle)) bundlecopy(incoming) else - return FALSE + return use_power(active_power_usage) - return TRUE /obj/machinery/photocopier/faxmachine/proc/send_admin_fax(mob/sender, destination) use_power(active_power_usage)