aboutsummaryrefslogtreecommitdiff
path: root/internal/game/room_reconcile.go
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-09-19 01:55:34 -0400
committerhistoria <[not public]>2026-09-19 01:55:34 -0400
commitcc33072eced3d5460512c09c42ec4531c807d7af (patch)
treeb1b451fa87fa389cb8343a3645372f3b43f5523e /internal/game/room_reconcile.go
parent2c38386484cdb507c4687caceb37e0b963e33594 (diff)
downloadthehouseoficarus-cc33072eced3d5460512c09c42ec4531c807d7af.tar.gz
fix: casino stake preservation, world state reconciliation, casino game registration
Diffstat (limited to 'internal/game/room_reconcile.go')
-rw-r--r--internal/game/room_reconcile.go21
1 files changed, 21 insertions, 0 deletions
diff --git a/internal/game/room_reconcile.go b/internal/game/room_reconcile.go
new file mode 100644
index 0000000..7491776
--- /dev/null
+++ b/internal/game/room_reconcile.go
@@ -0,0 +1,21 @@
+package game
+
+// ReconcileRoom refreshes a room's live runtime state from its on-disk
+// definition after a content edit, without a restart. Object instances and
+// item-spawn ground entries are reconciled by World; mob instances are dropped
+// and reseeded here because MobStore is owned by the game layer. Player-dropped
+// ground items and live reservations are preserved.
+//
+// It runs on the owner goroutine (the admin callbacks that call it already do)
+// and must not redispatch.
+func (g *Game) ReconcileRoom(roomID int) {
+ room, err := g.World.LoadRoom(roomID)
+ if err != nil {
+ return
+ }
+ g.World.ReconcileRoomState(roomID, room)
+ if g.MobStore != nil {
+ g.MobStore.RemoveMobsInRoom(roomID)
+ g.MobStore.SeedMobs(roomID, room.Mobs)
+ }
+}