From 89dab97ea2d92974a9903af6cb902b21485aebca Mon Sep 17 00:00:00 2001 From: Chinsky Date: Thu, 11 Sep 2014 05:19:25 +0400 Subject: [PATCH] Fixes #6305 Now autolathe spews all materials like protolathe does. --- code/game/machinery/autolathe.dm | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/code/game/machinery/autolathe.dm b/code/game/machinery/autolathe.dm index 5df804d84b4..e9213e98a5e 100644 --- a/code/game/machinery/autolathe.dm +++ b/code/game/machinery/autolathe.dm @@ -373,4 +373,15 @@ tot_rating += MB.rating storage_capacity["metal"] = tot_rating * 25000 - storage_capacity["glass"] = tot_rating * 12500 \ No newline at end of file + storage_capacity["glass"] = tot_rating * 12500 + +/obj/machinery/autolathe/dismantle() + ..() + var/list/sheets = list("metal" = /obj/item/stack/sheet/metal, "glass" = /obj/item/stack/sheet/glass) + + for(var/mat in stored_material) + var/T = sheets[mat] + var/obj/item/stack/sheet/S = new T + if(stored_material[mat] > S.perunit) + S.amount = round(stored_material[mat] / S.perunit) + S.loc = loc \ No newline at end of file