From bab5dd653039d026eb3d4e46da7aafef7137fe7c Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Sat, 19 Sep 2026 03:52:04 -0400 Subject: fix: journal in-game room insert/remove, rewrite non-room room refs on rename/swap, seed admin grid from edited room, type action switches --- internal/game/exit_migrate.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'internal/game/exit_migrate.go') diff --git a/internal/game/exit_migrate.go b/internal/game/exit_migrate.go index 66fccfe..f6df05d 100644 --- a/internal/game/exit_migrate.go +++ b/internal/game/exit_migrate.go @@ -1,6 +1,7 @@ package game import ( + "log" "strconv" "strings" @@ -190,4 +191,18 @@ func (g *Game) MigrateRoomIDsOnOwner(idMap map[int]int) { // lookups agree with the post-migration layout. g.World.RebuildRoomIndex(g.DataDir) g.RewriteRoomIDs(idMap) + + // Non-room content files (courses, modules, file-backed triggers) were + // rewritten with the same idMap. Reload their in-memory caches so gameplay + // follows the rename immediately instead of at the next restart. In-flight + // sequences hold pointers into the old trigger/step data, so abort them the + // same way a full content reload does. + if g.CourseStore != nil { + g.CourseStore.ReloadAll() + } + if err := g.LoadMods(); err != nil { + log.Printf("room-id migration: reload modules: %v", err) + } + g.abortAllSequences() + g.loadAllFlagTriggers() } -- cgit v1.2.3