From 365cdb4a606a9e041333c1d0548295e6407f87f6 Mon Sep 17 00:00:00 2001 From: "giacomand@gmail.com" Date: Wed, 25 Jul 2012 23:28:45 +0000 Subject: [PATCH] -Added an "inuse" check for the Light Replacer. -The Light Replacer will drop the replaced lights once again. -Fixed a runtime with the Plantbag and the All-In-One grinder. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4175 316c924e-a436-60f5-8080-3fe189b3f50e --- code/game/objects/devices/lightreplacer.dm | 9 +++++++-- code/modules/chemical/Chemistry-Machinery.dm | 3 ++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/code/game/objects/devices/lightreplacer.dm b/code/game/objects/devices/lightreplacer.dm index 40d5c87d874..c4968e7790d 100644 --- a/code/game/objects/devices/lightreplacer.dm +++ b/code/game/objects/devices/lightreplacer.dm @@ -53,6 +53,7 @@ var/max_uses = 20 var/uses = 0 + var/inuse = 0 var/emagged = 0 var/failmsg = "" // How much to increase per each glass? @@ -122,12 +123,15 @@ /obj/item/device/lightreplacer/proc/Use(var/mob/user) + if(inuse) return playsound(src.loc, 'click.ogg', 50, 1) var/pass = 0 + inuse = 1 if(do_after(user, 30)) playsound(src.loc, 'Deconstruct.ogg', 50, 1) AddUses(-1) pass = 1 + inuse = 0 return pass // Negative numbers will subtract @@ -146,8 +150,10 @@ if(CanUse(U)) if(!Use(U)) return U << "You replace the [target.fitting] with the [src]." + if(target.status != LIGHT_EMPTY) - var/obj/item/weapon/light/L1 = new target.light_type(src.loc) + + var/obj/item/weapon/light/L1 = new target.light_type(target.loc) L1.status = target.status L1.rigged = target.rigged L1.brightness = target.brightness @@ -168,7 +174,6 @@ target.update() del(L2) - // Leaving this here in case I get the go ahead to make emagged light replacers to insert rigged lights if(target.on && target.rigged) target.explode() return diff --git a/code/modules/chemical/Chemistry-Machinery.dm b/code/modules/chemical/Chemistry-Machinery.dm index 48d525e0382..f851d7ef370 100644 --- a/code/modules/chemical/Chemistry-Machinery.dm +++ b/code/modules/chemical/Chemistry-Machinery.dm @@ -748,7 +748,8 @@ if((holdingitems && holdingitems.len >= limit) || beaker.reagents.total_volume >= 80) //Sanity checking so the blender doesn't overfill user << "You fill the All-In-One grinder to the brim." break - if(src.contents.len < limit && src.reagents.total_volume < 80) + + if(!O.contents.len) user << "You empty the plant bag into the All-In-One grinder." src.updateUsrDialog()