diff options
| author | historia <[not public]> | 2026-07-09 17:47:39 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-07-09 17:47:39 -0400 |
| commit | 7ea40cbd00f7ddae53a8e43dd018d62ca798f8cf (patch) | |
| tree | 1d75ceb3db02d21d15c143df5aad0cab9aabdcdd /internal/admin/api_map.go | |
| parent | b888414c63c0e5fae0d33b3c5faea8a604d195fa (diff) | |
| download | thehouseoficarus-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.go | 19 |
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 } |
