Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes a few runtimes from HUD cycling (#6025)
# About the pull request Fixes a few runtimes from the 'Cycle Helmet HUD' keybind. Specifically: <hr> ``` runtime error: undefined proc or verb /obj/item/clothing/head/beret/cm/cycle huds(). - - proc name: down (/datum/keybinding/human/cycle_helmet_hud/down) - source file: human.dm,125 - usr: Sean Agg (/mob/living/carbon/human) - src: cycle_helmet_hud (/datum/keybinding/human/cycle_helmet_hud) - usr.loc: the floor (48,79,2) (/turf/open/floor/almayer) - call stack: - cycle_helmet_hud (/datum/keybinding/human/cycle_helmet_hud): down(SabreML (/client)) - SabreML (/client): keyDown("J") ``` Caused if the player was wearing a hat which wasn't a `/obj/item/clothing/head/helmet/marine` subtype. (In this case a beret) <hr> ``` runtime error: Cannot read null.vars - proc name: down (/datum/keybinding/human/cycle_helmet_hud/down) - source file: human.dm,127 - usr: Sean Agg (/mob/living/carbon/human) - src: cycle_helmet_hud (/datum/keybinding/human/cycle_helmet_hud) - usr.loc: the floor (48,78,2) (/turf/open/floor/almayer) - call stack: - cycle_helmet_hud (/datum/keybinding/human/cycle_helmet_hud): down(SabreML (/client)) - SabreML (/client): keyDown("J") ``` Caused if the player wasn't wearing a hat at all. <hr> ``` runtime error: Cannot execute null.set action overlay(). - proc name: down (/datum/keybinding/human/cycle_helmet_hud/down) - source file: human.dm,128 - usr: Sean Agg (/mob/living/carbon/human) - src: cycle_helmet_hud (/datum/keybinding/human/cycle_helmet_hud) - usr.loc: the floor (49,77,2) (/turf/open/floor/almayer) - call stack: - cycle_helmet_hud (/datum/keybinding/human/cycle_helmet_hud): down(SabreML (/client)) - SabreML (/client): keyDown("J") ``` Caused if the player was wearing a `/obj/item/clothing/head/helmet/marine` subtype, but it didn't have a HUD action. (In this case the reporter helmet) <hr> I should note that while this is mostly adding extra checks, I *did* remove the `?` from `human_user?.head` check. As far as I know it isn't possible for a client *not* to have an attached `mob`, and `/datum/keybinding/human/can_use()` covers that either way. # Explain why it's good for the game Three bugfixes for the price of one! # Testing Photographs and Procedure <details> <summary>Screenshots & Videos</summary> Put screenshots and videos here with an empty line between the screenshots and the `<details>` tags. </details> # Changelog :cl: fix: Fixed a few runtime errors caused by the 'Cycle Helmet HUD' keybind. /:cl:
- Loading branch information