mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
-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
This commit is contained in:
@@ -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 << "<span class='notice'>You replace the [target.fitting] with the [src].</span>"
|
||||
|
||||
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
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user