From c6d1cd5a5ed2d71cf9294d195d13027ba640f9d2 Mon Sep 17 00:00:00 2001 From: kettek Date: Sun, 30 Jun 2024 10:38:20 -0700 Subject: [PATCH] Prevent OOB focused room in autoplay --- internal/game/gamebuild.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/game/gamebuild.go b/internal/game/gamebuild.go index 103bcb5..561cb5a 100644 --- a/internal/game/gamebuild.go +++ b/internal/game/gamebuild.go @@ -313,7 +313,7 @@ func (s *GameStateBuild) Update(g *Game) GameState { j -= int(s.focusedRoom.size) } attempts++ - if j >= 7 || attempts > 10 { + if j < 0 || j >= 7 || attempts > 10 { break } }