From e670cec52168160c81c29fc491d714925ef6066c Mon Sep 17 00:00:00 2001 From: phil235 Date: Wed, 29 Jul 2015 20:31:11 +0200 Subject: [PATCH] Fixes being able to insert sheets into the protolathe from a distance (w/o telekinesis). Removes some unnecessary icon_state stuff, plus moving busy = 0 to after the end of the insertion animation. --- code/modules/research/protolathe.dm | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/code/modules/research/protolathe.dm b/code/modules/research/protolathe.dm index 07ab76f7b5d..0e998a0cb1b 100644 --- a/code/modules/research/protolathe.dm +++ b/code/modules/research/protolathe.dm @@ -165,18 +165,16 @@ Note: Must be placed west/left of and R&D console to function. var/obj/item/stack/sheet/stack = O var/amount = round(input("How many sheets do you want to add?") as num)//No decimals - if(!stack || stack.amount <= 0 || amount <= 0) + if(!stack || stack.amount <= 0 || amount <= 0 || !in_range(src, stack) || !user.Adjacent(src)) return if(amount > stack.amount) amount = stack.amount if(max_material_storage - TotalMaterials() < (amount*stack.perunit))//Can't overfill amount = min(stack.amount, round((max_material_storage-TotalMaterials())/stack.perunit)) - icon_state = "protolathe" busy = 1 use_power(max(1000, (MINERAL_MATERIAL_AMOUNT*amount/10))) user << "You add [amount] sheets to the [src.name]." - icon_state = "protolathe" if(istype(stack, /obj/item/stack/sheet/metal)) m_amount += amount * MINERAL_MATERIAL_AMOUNT else if(istype(stack, /obj/item/stack/sheet/glass)) @@ -196,11 +194,10 @@ Note: Must be placed west/left of and R&D console to function. else if(istype(stack, /obj/item/stack/sheet/mineral/adamantine)) adamantine_amount += amount * MINERAL_MATERIAL_AMOUNT stack.use(amount) - busy = 0 - src.updateUsrDialog() + updateUsrDialog() - src.overlays += "protolathe_[stack.name]" + overlays += "protolathe_[stack.name]" sleep(10) - src.overlays -= "protolathe_[stack.name]" + overlays -= "protolathe_[stack.name]" + busy = 0 - return