From 05066f241b74d33c6e4bbcd439ca8527d0c5d4c6 Mon Sep 17 00:00:00 2001 From: Ghommie Date: Sat, 15 Jun 2019 20:33:38 +0200 Subject: [PATCH] Improving keborgs' movement, not removing. --- .../mob/living/silicon/robot/robot_movement.dm | 12 +++++++----- 1 file changed, 7 insertions(+), 5 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 80598f134f..c7a2447be6 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 @@ -5,21 +5,23 @@ . = ..() if(. && sprinting && !(movement_type & FLYING) && canmove && !resting) if(!(cell?.use(25))) - togglesprint() + togglesprint(TRUE) /mob/living/silicon/robot/movement_delay() . = ..() if(!resting && !sprinting) . += 1 -/mob/living/silicon/robot/proc/togglesprint() //Basically a copypaste of the proc from /mob/living/carbon/human - sprinting = !sprinting +/mob/living/silicon/robot/proc/togglesprint(shutdown = FALSE) //Basically a copypaste of the proc from /mob/living/carbon/human + if(!shutdown && (!cell || cell.charge < 25)) + return FALSE + sprinting = shutdown ? FALSE : !sprinting if(!resting && canmove) if(sprinting) playsound_local(src, 'modular_citadel/sound/misc/sprintactivate.ogg', 50, FALSE, pressure_affected = FALSE) else - if(!(cell?.charge)) - return FALSE + if(shutdown) + playsound_local(src, 'sound/effects/light_flicker.ogg', 50, FALSE, pressure_affected = 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)