aboutsummaryrefslogtreecommitdiff
path: root/internal/game/cmd_walk.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/game/cmd_walk.go')
-rw-r--r--internal/game/cmd_walk.go9
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] {