From ae5d68c6f9b7884331e74c357dc9c0bdb0c983ed Mon Sep 17 00:00:00 2001 From: Ghommie Date: Sun, 2 Jun 2019 13:24:03 +0200 Subject: [PATCH] Fixes stunbatons' icons not properly updating on cell removal, and more cell charge leniency. --- code/game/objects/items/stunbaton.dm | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/code/game/objects/items/stunbaton.dm b/code/game/objects/items/stunbaton.dm index 5265f555da..3904355893 100644 --- a/code/game/objects/items/stunbaton.dm +++ b/code/game/objects/items/stunbaton.dm @@ -58,16 +58,15 @@ switch_status(FALSE) /obj/item/melee/baton/proc/switch_status(new_status = FALSE, silent = FALSE) - if(status == new_status) - return - status = new_status + if(status != new_status) + status = new_status + if(!silent) + playsound(loc, "sparks", 75, 1, -1) + if(status) + START_PROCESSING(SSobj, src) + else + STOP_PROCESSING(SSobj, src) update_icon() - if(!silent) - playsound(loc, "sparks", 75, 1, -1) - if(status) - START_PROCESSING(SSobj, src) - else - STOP_PROCESSING(SSobj, src) /obj/item/melee/baton/process() deductcharge(hitcost * 0.004, FALSE) @@ -93,7 +92,7 @@ if(cell) to_chat(user, "[src] already has a cell.") else - if(C.maxcharge < hitcost) + if(C.maxcharge < hitcost * STUNBATON_CHARGE_LENIENCY) to_chat(user, "[src] requires a higher capacity cell.") return if(!user.transferItemToLoc(W, src))