From 78f99a06678f807ef138fb607196d84712dcabdc Mon Sep 17 00:00:00 2001 From: Samuel Lison Date: Mon, 6 Jul 2026 14:55:55 +1000 Subject: [PATCH 1/2] fix: loot-bag owner beacon race + looting while dead MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Beacon: LootBagDropped fired the same frame the bag was created, so the Instance reference arrived as nil on the client (not yet replicated) and the owner beacon silently never appeared. The fire is now delayed 0.5s. - Dead looting: collect() never verified the collector was alive, so a corpse lying next to its own bag could scoop everything back before respawning. The server now rejects dead collectors (isAlive gate, Harvesting pattern). Live verification note: the running Studio session executed stale bytecode (old collect granted loot to a dead player even though the new source was synced) — verified source-in-place; behavior verification needs a Studio restart, which CI/release artifacts are unaffected by. Co-Authored-By: Claude Opus 4.8 --- CHANGELOG.md | 9 +++++++++ src/systems/LootBags.luau | 16 ++++++++++++++-- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 263feb5..c46387c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,15 @@ All notable changes to SurvivorCore are recorded here. The format follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html). At release time, `## Unreleased` is promoted to the new version and `main` is tagged `vX.Y.Z`. +## Unreleased + +### Fixed +- **Loot-bag beacon never appeared** — the owner's beacon remote fired the same frame the bag was + created, so the Instance reference arrived as `nil` on the client (not yet replicated) and the + beacon silently skipped. The fire is now delayed a beat past replication. +- **Looting while dead** — a dead player could scoop their own bag from the corpse before + respawning, defeating the corpse-run. The server now rejects collectors who aren't alive. + ## 0.7.1 — 2026-07-06 ### Fixed diff --git a/src/systems/LootBags.luau b/src/systems/LootBags.luau index 2f7d18b..7dd0aa5 100644 --- a/src/systems/LootBags.luau +++ b/src/systems/LootBags.luau @@ -113,6 +113,12 @@ local function collect(bag: Instance, player: Player) if looting[player] then return end + -- Dead players can't loot — the corpse falls right next to the bag, and a quick E while dead + -- would scoop everything back before the respawn corpse-run even begins. + local hum = player.Character and player.Character:FindFirstChildOfClass("Humanoid") + if not hum or hum.Health <= 0 then + return + end looting[player] = true local entries = {} @@ -262,9 +268,15 @@ local function dropBag(player: Player, position: Vector3) Hooks.run("lootbag:dropped", ctx) EventBridge.fire("lootbag:dropped", player, { position = position, items = total }) - -- Owner-only client juice: beacon + "your things dropped" toast. + -- Owner-only client juice: beacon + "your things dropped" toast. The beacon fire is DELAYED a + -- beat — the bag was created this frame, and an Instance sent before it replicates arrives as + -- nil on the client (the beacon would silently never appear). if cfg.OwnerBeacon ~= false then - Remotes.event("LootBagDropped"):FireClient(player, bag, lifetime) + task.delay(0.5, function() + if bag.Parent and player.Parent then + Remotes.event("LootBagDropped"):FireClient(player, bag, lifetime) + end + end) end Remotes.event("Notify"):FireClient(player, { kind = "death", From 52d9aea26b37641f0ad84985a9556deb7322d3ee Mon Sep 17 00:00:00 2001 From: Samuel Lison Date: Mon, 6 Jul 2026 14:56:50 +1000 Subject: [PATCH 2/2] chore(release): v0.7.2 Co-Authored-By: Claude Opus 4.8 --- CHANGELOG.md | 2 +- src/init.luau | 2 +- wally.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c46387c..5505011 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ All notable changes to SurvivorCore are recorded here. The format follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html). At release time, `## Unreleased` is promoted to the new version and `main` is tagged `vX.Y.Z`. -## Unreleased +## 0.7.2 — 2026-07-06 ### Fixed - **Loot-bag beacon never appeared** — the owner's beacon remote fired the same frame the bag was diff --git a/src/init.luau b/src/init.luau index a140ea2..c7f026a 100644 --- a/src/init.luau +++ b/src/init.luau @@ -65,7 +65,7 @@ require(script.shared.LootBagsConfig) local SurvivorCore = {} -SurvivorCore.VERSION = "0.7.1" +SurvivorCore.VERSION = "0.7.2" -- Foundation SurvivorCore.Config = Config diff --git a/wally.toml b/wally.toml index c73bfb9..767a2bb 100644 --- a/wally.toml +++ b/wally.toml @@ -1,7 +1,7 @@ [package] name = "temujincalidius/survivorcore" description = "Batteries-included, creator-extensible survival game framework for Roblox." -version = "0.7.1" +version = "0.7.2" license = "MIT" authors = ["Samuel Lison"] registry = "https://github.com/UpliftGames/wally-index"