diff options
| author | historia <[not public]> | 2026-09-19 03:52:04 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-09-19 03:52:04 -0400 |
| commit | bab5dd653039d026eb3d4e46da7aafef7137fe7c (patch) | |
| tree | 9a1d8686dbcef8c145e3593511153768ae08962c /internal/game/exit_migrate.go | |
| parent | 0e60567a7a0addb9421769ee7be7853bfa8788cb (diff) | |
| download | thehouseoficarus-bab5dd653039d026eb3d4e46da7aafef7137fe7c.tar.gz | |
fix: journal in-game room insert/remove, rewrite non-room room refs on rename/swap, seed admin grid from edited room, type action switches
Diffstat (limited to 'internal/game/exit_migrate.go')
| -rw-r--r-- | internal/game/exit_migrate.go | 15 |
1 files changed, 15 insertions, 0 deletions
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() } |
