Fix: Reset smithing machinery operation state when power is lost during operation, preventing equipment from getting stuck (#29419)

This commit is contained in:
PGray
2025-06-07 15:15:26 +01:00
committed by GitHub
parent 4f0e877948
commit 796f91aeb5
+5
View File
@@ -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)