diff options
| author | historia <[not public]> | 2026-09-18 16:13:49 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-09-18 16:13:49 -0400 |
| commit | 194164a77eb4f2479b94c19e6f0e1278ab608781 (patch) | |
| tree | 53413add8ed6f32a34d1733397e380cc98ef70ef /internal/world/world.go | |
| parent | 67e01aab85607b9e601185c7d62dff576af3bb43 (diff) | |
| download | thehouseoficarus-194164a77eb4f2479b94c19e6f0e1278ab608781.tar.gz | |
fix: more casino, economy, gameplay, security, and world data hardening gaps
Diffstat (limited to 'internal/world/world.go')
| -rw-r--r-- | internal/world/world.go | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/internal/world/world.go b/internal/world/world.go index 7475ce0..a084f63 100644 --- a/internal/world/world.go +++ b/internal/world/world.go @@ -91,16 +91,24 @@ func (w *World) SeedGroundItems(roomID int) { w.mu.Unlock() return } - w.seeded[roomID] = true w.mu.Unlock() room, err := w.LoadRoom(roomID) if err != nil { + // Do NOT mark a room seeded before it loads: a dangling exit (or a + // not-yet-created room) would otherwise permanently disable its item + // spawns even after the room is fixed/created. return } w.mu.Lock() defer w.mu.Unlock() + // Re-check under the lock: a concurrent seed may have won the race while + // this call was loading. + if w.seeded[roomID] { + return + } + w.seeded[roomID] = true for _, s := range room.ItemSpawns { merged := false |
