aboutsummaryrefslogtreecommitdiff
path: root/internal/world/room_migrate.go
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-07-08 19:59:14 -0400
committerhistoria <[not public]>2026-07-08 19:59:14 -0400
commit09d325dcf5e779eab5550d3fd3377bde50101428 (patch)
treea433be903aabbf1d2eadce2aacdac12a9eb8dde0 /internal/world/room_migrate.go
parent9184377301c2604e003f36426788c032fb0ca524 (diff)
downloadthehouseoficarus-09d325dcf5e779eab5550d3fd3377bde50101428.tar.gz
feat: unify on use, on look, and on kill. all support same conditions/actions now.
Diffstat (limited to 'internal/world/room_migrate.go')
-rw-r--r--internal/world/room_migrate.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/internal/world/room_migrate.go b/internal/world/room_migrate.go
index 6d79499..946417f 100644
--- a/internal/world/room_migrate.go
+++ b/internal/world/room_migrate.go
@@ -16,7 +16,22 @@ func (r *Room) RewriteRoomIDs(idMap map[int]int) bool {
}
changed := false
for dir, exit := range r.Exits {
+ var exitChanged bool
if remapInt(idMap, &exit.Room) {
+ exitChanged = true
+ }
+ for i := range exit.OnTraverse {
+ if exit.OnTraverse[i].Action != nil {
+ if remapInt(idMap, &exit.OnTraverse[i].Action.Teleport) {
+ exitChanged = true
+ }
+ if exit.OnTraverse[i].Action.SpawnMob != nil &&
+ remapIntSlice(idMap, exit.OnTraverse[i].Action.SpawnMob.DespawnRooms) {
+ exitChanged = true
+ }
+ }
+ }
+ if exitChanged {
r.Exits[dir] = exit
changed = true
}