diff options
| author | historia <[not public]> | 2026-09-19 01:55:34 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-09-19 01:55:34 -0400 |
| commit | cc33072eced3d5460512c09c42ec4531c807d7af (patch) | |
| tree | b1b451fa87fa389cb8343a3645372f3b43f5523e /internal/game/room_reconcile.go | |
| parent | 2c38386484cdb507c4687caceb37e0b963e33594 (diff) | |
| download | thehouseoficarus-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.go | 21 |
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) + } +} |
