fixes the bug where you can sometimes get permanently stuck sprinting when using the sprint hotkey (#8033)

This commit is contained in:
deathride58
2019-02-22 09:09:41 -05:00
committed by kevinz000
parent 963833cf11
commit 7cc463a190
4 changed files with 12 additions and 4 deletions
@@ -1,13 +1,13 @@
/mob/living/carbon/human/key_down(_key, client/user)
switch(_key)
if("Shift")
togglesprint()
sprint_hotkey(TRUE)
return
return ..()
/mob/living/carbon/human/key_up(_key, client/user)
switch(_key)
if("Shift")
togglesprint()
sprint_hotkey(FALSE)
return
return ..()
@@ -1,13 +1,13 @@
/mob/living/silicon/robot/key_down(_key, client/user)
switch(_key)
if("Shift")
togglesprint()
sprint_hotkey(TRUE)
return
return ..()
/mob/living/silicon/robot/key_up(_key, client/user)
switch(_key)
if("Shift")
togglesprint()
sprint_hotkey(FALSE)
return
return ..()
@@ -31,3 +31,7 @@
for(var/obj/screen/sprintbutton/selector in hud_used.static_inventory)
selector.insert_witty_toggle_joke_here(src)
return TRUE
/mob/living/carbon/human/proc/sprint_hotkey(targetstatus)
if(targetstatus ? !sprinting : sprinting)
togglesprint()
@@ -23,3 +23,7 @@
for(var/obj/screen/sprintbutton/selector in hud_used.static_inventory)
selector.insert_witty_toggle_joke_here(src)
return TRUE
/mob/living/silicon/robot/proc/sprint_hotkey(targetstatus)
if(targetstatus ? !sprinting : sprinting)
togglesprint()