aboutsummaryrefslogtreecommitdiff
path: root/internal/admin/api_map.go
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-07-09 17:47:39 -0400
committerhistoria <[not public]>2026-07-09 17:47:39 -0400
commit7ea40cbd00f7ddae53a8e43dd018d62ca798f8cf (patch)
tree1d75ceb3db02d21d15c143df5aad0cab9aabdcdd /internal/admin/api_map.go
parentb888414c63c0e5fae0d33b3c5faea8a604d195fa (diff)
downloadthehouseoficarus-7ea40cbd00f7ddae53a8e43dd018d62ca798f8cf.tar.gz
feat(admin): exits to non-existent rooms show on map as ?
Diffstat (limited to 'internal/admin/api_map.go')
-rw-r--r--internal/admin/api_map.go19
1 files changed, 17 insertions, 2 deletions
diff --git a/internal/admin/api_map.go b/internal/admin/api_map.go
index f5fd9ee..6e62d9e 100644
--- a/internal/admin/api_map.go
+++ b/internal/admin/api_map.go
@@ -175,6 +175,7 @@ func (s *AdminServer) handleMap(w http.ResponseWriter, r *http.Request) {
Bidirectional bool `json:"bidirectional"`
Hidden bool `json:"hidden"`
AlwaysBlocked bool `json:"always_blocked"`
+ Missing bool `json:"missing"`
}
type UDLink struct {
@@ -243,8 +244,22 @@ func (s *AdminServer) handleMap(w http.ResponseWriter, r *http.Request) {
if target <= 0 {
continue
}
- targetCoord, ok := g.Coord[target]
- if !ok {
+ targetCoord, hasCoord := g.Coord[target]
+ targetExists := s.world.RoomIndex()[target]
+
+ if !targetExists || !hasCoord {
+ if dir != world.Up && dir != world.Down {
+ key := linkKey(rid, target)
+ if !seenLinks[key] {
+ seenLinks[key] = true
+ links = append(links, LinkEntry{
+ From: rid,
+ To: target,
+ Dir: string(dir),
+ Missing: true,
+ })
+ }
+ }
continue
}