Fixes defibillator runtime
This commit is contained in:
@@ -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]")
|
||||
|
||||
Reference in New Issue
Block a user