Skip to content

Commit

Permalink
fix: clamp max level
Browse files Browse the repository at this point in the history
  • Loading branch information
akorzunin committed Sep 16, 2024
1 parent 48951ef commit 7943dd3
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/components/controls/MenuControls.gd
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,11 @@ func call_menu_action():
if action == "menu_level_select":
menuSpawner.open_menu_section(
controlledNode,
# R:TODO check for actual levels avaliable
{items = LevelPatterns.get_menu_levels(G.settings.MAX_LEVEL)}
{
items = LevelPatterns.get_menu_levels(
clampi(G.settings.MAX_LEVEL, 0, LevelPatterns.levels.size - 1)
)
}
)
return

Expand Down

0 comments on commit 7943dd3

Please sign in to comment.