[MIRROR] fixes runtime when deconstruct() on a grill with no item in it. [MDB IGNORE] (#16004)

* fixes runtime when deconstruct() on a grill with no item in it. (#69602)

* fixes runtime when deconstruct() on a grill with no item in it.

Co-authored-by: ShizCalev <ShizCalev@users.noreply.github.com>
This commit is contained in:
SkyratBot
2022-09-02 11:31:14 +01:00
committed by GitHub
co-authored by ShizCalev
parent 22c8e76b40
commit 5567fac8db
@@ -116,7 +116,8 @@
return TRUE
/obj/machinery/grill/deconstruct(disassembled = TRUE)
finish_grill()
if(grilled_item)
finish_grill()
if(!(flags_1 & NODECONSTRUCT_1))
new /obj/item/stack/sheet/iron(loc, 5)
new /obj/item/stack/rods(loc, 5)
@@ -134,9 +135,10 @@
return ..()
/obj/machinery/grill/proc/finish_grill()
SEND_SIGNAL(grilled_item, COMSIG_GRILL_FOOD, grilled_item, grill_time)
if(grilled_item)
SEND_SIGNAL(grilled_item, COMSIG_GRILL_FOOD, grilled_item, grill_time)
UnregisterSignal(grilled_item, COMSIG_GRILL_COMPLETED)
grill_time = 0
UnregisterSignal(grilled_item, COMSIG_GRILL_COMPLETED)
grill_loop.stop()
///Called when a food is transformed by the grillable component