aboutsummaryrefslogtreecommitdiff
path: root/internal/game/cmd_swapid.go
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-09-18 15:16:44 -0400
committerhistoria <[not public]>2026-09-18 15:16:44 -0400
commit7eab582d8a8ee2af1a6baae7baf0696c7005de2e (patch)
tree902bbc8c6e39c9f62f779ca23267714ec420b9f5 /internal/game/cmd_swapid.go
parent153acb7f644d755c45533b7c5311e3ffa47e8973 (diff)
downloadthehouseoficarus-7eab582d8a8ee2af1a6baae7baf0696c7005de2e.tar.gz
fix: harden triggers, economy, casino, world data, and admin/net paths
Diffstat (limited to 'internal/game/cmd_swapid.go')
-rw-r--r--internal/game/cmd_swapid.go13
1 files changed, 7 insertions, 6 deletions
diff --git a/internal/game/cmd_swapid.go b/internal/game/cmd_swapid.go
index ef862b9..9ee832a 100644
--- a/internal/game/cmd_swapid.go
+++ b/internal/game/cmd_swapid.go
@@ -141,12 +141,13 @@ func (g *Game) executeSwapID(sess *net.Session, args []string, rawInput string)
updated++
}
- // Migrate room-ID-embedded state across all characters (online + offline):
- // discovered-exit player flags, current RoomID, EnterSeqRoom, MapSymbols,
- // and RoomsVisited. This is what the player asked for — without it,
- // swapid leaves every character's hidden_exit_<id>_<dir> flags (and more)
- // pointing at stale room IDs.
- g.RewriteRoomIDs(idMap)
+ // Full runtime migration: Hub room buckets, casino room keys, world
+ // room-keyed state (ground items, seeded markers, object states), live
+ // mob instances, the room index, and every character's embedded room-ID
+ // state. Without this, a swap leaves live gameplay attached to the old
+ // locations until restart. This runs on the owner (swapid is executed
+ // from the owner command loop) and must not dispatch again.
+ g.MigrateRoomIDsOnOwner(idMap)
sess.WriteLine(fmt.Sprintf("Swapped room IDs %d and %d (%d files updated).", id1, id2, updated))
}