From 280e7d7d8113796894f6cdf305ee51b9fc29f052 Mon Sep 17 00:00:00 2001 From: Ghommie Date: Sat, 15 Jun 2019 04:36:40 +0200 Subject: [PATCH] stops borgs from sprinting into negative cell charge. --- .../code/modules/mob/living/silicon/robot/robot_movement.dm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modular_citadel/code/modules/mob/living/silicon/robot/robot_movement.dm b/modular_citadel/code/modules/mob/living/silicon/robot/robot_movement.dm index 598690590c..80598f134f 100644 --- a/modular_citadel/code/modules/mob/living/silicon/robot/robot_movement.dm +++ b/modular_citadel/code/modules/mob/living/silicon/robot/robot_movement.dm @@ -4,8 +4,8 @@ /mob/living/silicon/robot/Move(NewLoc, direct) . = ..() if(. && sprinting && !(movement_type & FLYING) && canmove && !resting) - if(istype(cell)) - cell.charge -= 25 + if(!(cell?.use(25))) + togglesprint() /mob/living/silicon/robot/movement_delay() . = ..() @@ -18,6 +18,8 @@ if(sprinting) playsound_local(src, 'modular_citadel/sound/misc/sprintactivate.ogg', 50, FALSE, pressure_affected = FALSE) else + if(!(cell?.charge)) + return FALSE playsound_local(src, 'modular_citadel/sound/misc/sprintdeactivate.ogg', 50, FALSE, pressure_affected = FALSE) if(hud_used && hud_used.static_inventory) for(var/obj/screen/sprintbutton/selector in hud_used.static_inventory)