Skip to content

Commit

Permalink
Add null conditional operators to helmet code (#5660)
Browse files Browse the repository at this point in the history
# About the pull request

So I am not able to reproduce the runtime spam errors reported in #5656
prompting #5655 but I have added null conditional operators where it is
complaining.

# Explain why it's good for the game

Less runtimes? Fixes #5656

# Testing Photographs and Procedure
Untested other than confirming it still seems fine? Please let me know
if you know how to reproduce it.

# Changelog
:cl: Drathek
fix: Added more null testing to helmet visors.
/:cl:
  • Loading branch information
Drulikar authored Feb 4, 2024
1 parent ae5e0f4 commit 59b6267
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions code/modules/clothing/head/helmet.dm
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,7 @@ GLOBAL_LIST_INIT(allowed_helmet_items, list(
if(length(total_visors) > iterator)
var/obj/item/device/helmet_visor/next_visor = total_visors[iterator + 1]

if(!isnull(GLOB.huds[next_visor.hud_type].hudusers[user]))
if(!isnull(GLOB.huds[next_visor.hud_type]?.hudusers[user]))
iterator++
skipped_hud = TRUE
continue
Expand All @@ -694,7 +694,7 @@ GLOBAL_LIST_INIT(allowed_helmet_items, list(

for(var/obj/item/device/helmet_visor/new_visor in total_visors)

if(!isnull(GLOB.huds[new_visor.hud_type].hudusers[user]))
if(!isnull(GLOB.huds[new_visor.hud_type]?.hudusers[user]))
continue

active_visor = new_visor
Expand Down

0 comments on commit 59b6267

Please sign in to comment.