From a51f7a53aa2c487ebf94ba0363038574ae8bb590 Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Tue, 7 Jul 2026 00:22:32 -0400 Subject: feat: hidden exits (and related flags) work with commands that change room ids. exit code simplified and unified between impassable and blocked exits. --- internal/game/cmd_walk.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'internal/game/cmd_walk.go') diff --git a/internal/game/cmd_walk.go b/internal/game/cmd_walk.go index 4b3b7e0..de10cbd 100644 --- a/internal/game/cmd_walk.go +++ b/internal/game/cmd_walk.go @@ -23,7 +23,7 @@ func (g *Game) doWalk(sess *net.Session, args []string) { input := strings.Join(args, "") if roomID, err := strconv.Atoi(input); err == nil { - path := g.findPathToRoom(p, p.RoomID, roomID) + path := g.findPathToRoom(sess, p.RoomID, roomID) if path == nil { sess.WriteLine(fmt.Sprintf("No path found to room #%d.", roomID)) return @@ -188,7 +188,7 @@ var walkSearchDirs = []world.ExitDir{ world.Up, world.Down, } -func (g *Game) findPathToRoom(p *player.Player, fromRoom, toRoom int) []string { +func (g *Game) findPathToRoom(sess *net.Session, fromRoom, toRoom int) []string { if fromRoom == toRoom { return nil } @@ -216,10 +216,7 @@ func (g *Game) findPathToRoom(p *player.Player, fromRoom, toRoom int) []string { if !exists { continue } - if !p.GodMode && exitDef.AlwaysBlocked { - continue - } - if exitDef.Hidden && !g.exitDiscovered(p, cur.roomID, dir) { + if ed := g.exitDisplayState(sess, cur.roomID, dir, exitDef); !ed.Visible || ed.Blocked { continue } if visited[exitDef.Room] { -- cgit v1.2.3