From 4bc1daaf259e0c19c5fe4a12ec8bc7f6e5a735c1 Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Mon, 5 Oct 2026 20:00:02 -0400 Subject: feat: terminal talk action, typed pai gow poker phase --- internal/game/exit_migrate.go | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'internal/game/exit_migrate.go') diff --git a/internal/game/exit_migrate.go b/internal/game/exit_migrate.go index f6df05d..4edab95 100644 --- a/internal/game/exit_migrate.go +++ b/internal/game/exit_migrate.go @@ -6,6 +6,7 @@ import ( "strings" "thehouseoficarus/internal/player" + "thehouseoficarus/internal/world" ) // rewritePlayerRoomIDs remaps room-ID-embedded state in a single player per @@ -21,10 +22,10 @@ func rewritePlayerRoomIDs(p *player.Player, idMap map[int]int) bool { return false } changed := false - if remapScalar(idMap, &p.RoomID) { + if world.RemapInt(idMap, &p.RoomID) { changed = true } - if p.PendingSequence != nil && p.PendingSequence.RoomID != 0 && remapScalar(idMap, &p.PendingSequence.RoomID) { + if p.PendingSequence != nil && p.PendingSequence.RoomID != 0 && world.RemapInt(idMap, &p.PendingSequence.RoomID) { changed = true } if len(p.Flags) > 0 && rewriteDiscoveredExitFlags(p.Flags, idMap) { @@ -41,14 +42,6 @@ func rewritePlayerRoomIDs(p *player.Player, idMap map[int]int) bool { return changed } -func remapScalar(idMap map[int]int, n *int) bool { - if newID, ok := idMap[*n]; ok && newID != *n { - *n = newID - return true - } - return false -} - // rewriteDiscoveredExitFlags rewrites hidden_exit__ flag keys, // remapping the embedded roomID per idMap. Flag values are preserved. func rewriteDiscoveredExitFlags(flags map[string]any, idMap map[int]int) bool { -- cgit v1.2.3