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
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions code/datums/keybinding/human.dm
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,18 @@
if(.)
return

// Get the user's marine helmet (if they're wearing one)
var/mob/living/carbon/human/human_user = user.mob
var/obj/item/clothing/head/helmet/marine/marine_helmet = human_user?.head
var/cycled_hud = marine_helmet?.cycle_huds(human_user)
var/obj/item/clothing/head/helmet/marine/marine_helmet = human_user.head
if(!istype(marine_helmet))
// If their hat isn't a marine helmet, or is null, return.
return

// Cycle the HUD on the helmet.
var/cycled_hud = marine_helmet.cycle_huds(human_user)

// Update the helmet's 'cycle hud' action button
var/datum/action/item_action/cycle_helmet_huds/cycle_action = locate() in marine_helmet.actions
cycle_action.set_action_overlay(cycled_hud)
cycle_action?.set_action_overlay(cycled_hud)

return TRUE
Loading