From 153acb7f644d755c45533b7c5311e3ffa47e8973 Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Fri, 18 Sep 2026 05:31:09 -0400 Subject: fix: harden engine across casino, economy, concurrency, security, and content --- internal/world/world.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'internal/world/world.go') diff --git a/internal/world/world.go b/internal/world/world.go index c5d0841..6a0313d 100644 --- a/internal/world/world.go +++ b/internal/world/world.go @@ -2,6 +2,7 @@ package world import ( "fmt" + "log" "os" "path/filepath" "strconv" @@ -52,6 +53,13 @@ func (w *World) LoadRoom(id int) (*Room, error) { if err := yaml.Unmarshal(data, &room); err != nil { return nil, fmt.Errorf("parse room %d: %w", id, err) } + // Room ID comes from the filename (room.ID = id below); a mismatched + // declared id: is silently ignored, so surface it rather than leave the + // author believing their written id is in use. + if room.ID != 0 && room.ID != id { + log.Printf("room %d: file %s declares id %d but is loaded as room %d; the filename is authoritative and the declared id is ignored", + id, path, room.ID, id) + } room.ID = id if room.Exits == nil { room.Exits = make(map[ExitDir]ExitDef) -- cgit v1.2.3