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/world/room_migrate.go | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'internal/world/room_migrate.go') diff --git a/internal/world/room_migrate.go b/internal/world/room_migrate.go index 42cd1ae..12859f2 100644 --- a/internal/world/room_migrate.go +++ b/internal/world/room_migrate.go @@ -25,7 +25,7 @@ func (r *Room) RewriteRoomIDs(idMap map[int]int) bool { // Exit targets + their on_traverse steps + exit/desc conditions. for dir, exit := range r.Exits { var exitChanged bool - if remapInt(idMap, &exit.Room) { + if RemapInt(idMap, &exit.Room) { exitChanged = true } if remapTriggers(idMap, exit.OnTraverse) { @@ -166,7 +166,7 @@ func remapStepList(idMap map[int]int, steps []behavior.Step) bool { changed := false for i := range steps { s := &steps[i] - if remapInt(idMap, &s.Teleport) { + if RemapInt(idMap, &s.Teleport) { changed = true } if s.SpawnMob != nil && remapIntSlice(idMap, s.SpawnMob.DespawnRooms) { @@ -186,7 +186,7 @@ func remapCondition(idMap map[int]int, c *behavior.Condition) bool { return false } changed := false - if c.Room != 0 && remapInt(idMap, &c.Room) { + if c.Room != 0 && RemapInt(idMap, &c.Room) { changed = true } for i := range c.AllOf { @@ -202,7 +202,10 @@ func remapCondition(idMap map[int]int, c *behavior.Condition) bool { return changed } -func remapInt(idMap map[int]int, n *int) bool { +// RemapInt rewrites *n through idMap (oldID -> newID) and reports whether it +// changed. Shared by the room-file and player-state migrations so they cannot +// disagree on the remap semantics. +func RemapInt(idMap map[int]int, n *int) bool { if newID, ok := idMap[*n]; ok && newID != *n { *n = newID return true @@ -213,7 +216,7 @@ func remapInt(idMap map[int]int, n *int) bool { func remapIntSlice(idMap map[int]int, slice []int) bool { changed := false for i := range slice { - if remapInt(idMap, &slice[i]) { + if RemapInt(idMap, &slice[i]) { changed = true } } -- cgit v1.2.3