Fixes a Modulo Moment in lobby screens (#21869)

see title

(++index % num_lobby_screens) will only ever get you [0,
num_lobby_screens), which is why it maxes with 1. but that still ignores
the last screen. so instead we just do the smart thing which is to add
+1 after.
This commit is contained in:
Wildkins
2026-02-14 16:46:43 +00:00
committed by GitHub
parent 4927a77499
commit 2e8e10a902
2 changed files with 17 additions and 2 deletions
+4 -2
View File
@@ -138,9 +138,11 @@ ABSTRACT_TYPE(/atom/movable/screen/new_player)
icon_state = pick(SSatlas.current_map.lobby_screens)
return
if(length(SSatlas.current_map.lobby_screens) >= 2)
var/num_lobby_screens = length(SSatlas.current_map.lobby_screens)
if(num_lobby_screens >= 2)
//Advance to the next icon
lobby_screen_index = max(++lobby_screen_index % length(SSatlas.current_map.lobby_screens), 1)
lobby_screen_index = (lobby_screen_index % num_lobby_screens) + 1
animate(src, alpha = 0, time = 1 SECOND)