diff options
| author | historia <[not public]> | 2026-10-05 20:00:02 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-10-05 20:00:02 -0400 |
| commit | 4bc1daaf259e0c19c5fe4a12ec8bc7f6e5a735c1 (patch) | |
| tree | f7ea1da2f88f37c44b937aaaf1fd12c722811147 /internal/game/exit_migrate.go | |
| parent | a5447965e7808d656a5e5d9326a9ca0231148f85 (diff) | |
| download | thehouseoficarus-4bc1daaf259e0c19c5fe4a12ec8bc7f6e5a735c1.tar.gz | |
feat: terminal talk action, typed pai gow poker phase
Diffstat (limited to 'internal/game/exit_migrate.go')
| -rw-r--r-- | internal/game/exit_migrate.go | 13 |
1 files changed, 3 insertions, 10 deletions
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_<roomID>_<dir> flag keys, // remapping the embedded roomID per idMap. Flag values are preserved. func rewriteDiscoveredExitFlags(flags map[string]any, idMap map[int]int) bool { |
