Fixes defibillator runtime

This commit is contained in:
ShizCalev
2018-05-20 18:28:11 -04:00
committed by letterjay
parent 6489ef5511
commit 5964fa0712
+4 -4
View File
@@ -46,11 +46,11 @@
update_charge()
/obj/item/defibrillator/proc/update_power()
if(cell)
if(cell.charge < paddles.revivecost)
if(!QDELETED(cell))
if(QDELETED(paddles) || cell.charge < paddles.revivecost)
powered = FALSE
else
powered = 1
powered = TRUE
else
powered = FALSE
@@ -67,7 +67,7 @@
/obj/item/defibrillator/proc/update_charge()
if(powered) //so it doesn't show charge if it's unpowered
if(cell)
if(!QDELETED(cell))
var/ratio = cell.charge / cell.maxcharge
ratio = CEILING(ratio*4, 1) * 25
add_overlay("[initial(icon_state)]-charge[ratio]")