diff options
| author | historia <[not public]> | 2026-07-05 22:35:21 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-07-05 22:35:21 -0400 |
| commit | 94823b52168b44894fb5e9c960358ed02ebb122b (patch) | |
| tree | 3060799b89bb7edfa708c72bdd981107d40f4d09 /internal/game/cmd_walk.go | |
| parent | 843fa6db681e494bf46e191655323a40577542b5 (diff) | |
| download | thehouseoficarus-94823b52168b44894fb5e9c960358ed02ebb122b.tar.gz | |
feat: courses gui overhaul, add course tab to map, add hidden exits to give courses structure
Diffstat (limited to 'internal/game/cmd_walk.go')
| -rw-r--r-- | internal/game/cmd_walk.go | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/internal/game/cmd_walk.go b/internal/game/cmd_walk.go index ec62eec..9bc7183 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.RoomID, roomID) + path := g.findPathToRoom(p.RoomID, roomID, p.GodMode) 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(fromRoom, toRoom int) []string { +func (g *Game) findPathToRoom(fromRoom, toRoom int, godMode bool) []string { if fromRoom == toRoom { return nil } @@ -216,6 +216,9 @@ func (g *Game) findPathToRoom(fromRoom, toRoom int) []string { if !exists { continue } + if exitDef.Hidden && !godMode { + continue + } if visited[exitDef.Room] { continue } |
