diff options
| author | historia <[not public]> | 2026-07-07 00:22:32 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-07-07 00:22:32 -0400 |
| commit | a51f7a53aa2c487ebf94ba0363038574ae8bb590 (patch) | |
| tree | b393a8f9e4732b40f6fe8058d086bd631537ad3b /internal/game/cmd_walk.go | |
| parent | 9292634f2f8d71a53879ff07e1330c671b207d51 (diff) | |
| download | thehouseoficarus-a51f7a53aa2c487ebf94ba0363038574ae8bb590.tar.gz | |
feat: hidden exits (and related flags) work with commands that change room ids. exit code simplified and unified between impassable and blocked exits.
Diffstat (limited to 'internal/game/cmd_walk.go')
| -rw-r--r-- | internal/game/cmd_walk.go | 9 |
1 files changed, 3 insertions, 6 deletions
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] { |
