Skip to content

Commit

Permalink
base
Browse files Browse the repository at this point in the history
  • Loading branch information
Staykeu committed Jan 31, 2024
1 parent ec89257 commit 6f8f571
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions code/modules/clothing/head/helmet.dm
Original file line number Diff line number Diff line change
Expand Up @@ -670,8 +670,15 @@ GLOBAL_LIST_INIT(allowed_helmet_items, list(
for(var/hud_type in total_visors)
if(hud_type == active_visor)
if(length(total_visors) > iterator)
active_visor = total_visors[(iterator + 1)]
toggle_visor(user, total_visors[iterator], TRUE)
var/obj/item/device/helmet_visor/current_visor = 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]))
iterator++
continue

active_visor = next_visor
toggle_visor(user, current_visor, silent = TRUE) // disables the old visor
toggle_visor(user)
return active_visor
else
Expand All @@ -680,15 +687,15 @@ GLOBAL_LIST_INIT(allowed_helmet_items, list(
return FALSE
iterator++

if(total_visors[1])
active_visor = total_visors[1]
for(var/obj/item/device/helmet_visor/new_visor in total_visors)

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

active_visor = new_visor
toggle_visor(user)
return active_visor

active_visor = null
recalculate_visors(user)
return FALSE

/datum/action/item_action/cycle_helmet_huds/New(Target, obj/item/holder)
. = ..()
name = "Cycle helmet HUD"
Expand Down

0 comments on commit 6f8f571

Please sign in to comment.