Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes a few runtimes from HUD cycling #6025

Merged
merged 2 commits into from
Mar 31, 2024

Conversation

SabreML
Copy link
Member

@SabreML SabreML commented Mar 27, 2024

About the pull request

Fixes a few runtimes from the 'Cycle Helmet HUD' keybind.
Specifically:


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)


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.


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)


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

Screenshots & Videos

Put screenshots and videos here with an empty line between the screenshots and the <details> tags.

Changelog

🆑
fix: Fixed a few runtime errors caused by the 'Cycle Helmet HUD' keybind.
/:cl:

@github-actions github-actions bot added the Fix Fix one bug, make ten more label Mar 27, 2024
@harryob harryob added this pull request to the merge queue Mar 31, 2024
Merged via the queue into cmss13-devs:master with commit a50f6b4 Mar 31, 2024
26 checks passed
cm13-github added a commit that referenced this pull request Mar 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fix Fix one bug, make ten more
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants