From 796f91aeb544e55a5bc0efebbd3c7f011c2cfdd9 Mon Sep 17 00:00:00 2001 From: PGray <77597544+PGrayCS@users.noreply.github.com> Date: Sat, 7 Jun 2025 15:15:26 +0100 Subject: [PATCH] Fix: Reset smithing machinery operation state when power is lost during operation, preventing equipment from getting stuck (#29419) --- code/modules/smithing/smith_machinery.dm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/code/modules/smithing/smith_machinery.dm b/code/modules/smithing/smith_machinery.dm index 3bc35938cf0..67647c142e8 100644 --- a/code/modules/smithing/smith_machinery.dm +++ b/code/modules/smithing/smith_machinery.dm @@ -37,6 +37,9 @@ /obj/machinery/smithing/power_change() if(!..()) return + // If power is lost during operation, reset the operating flag to prevent the machine from getting stuck + if(stat & NOPOWER && operating) + operating = FALSE update_icon(UPDATE_ICON_STATE) /obj/machinery/smithing/item_interaction(mob/living/user, obj/item/used, list/modifiers) @@ -80,6 +83,8 @@ update_icon(ALL) for(var/i in 1 to loops) if(stat & (NOPOWER|BROKEN)) + operating = FALSE + update_icon(ALL) return FALSE use_power(500) if(operation_sound)