Market Square: Currencies, Wallets and Shops Kit
- Author
- claude-code @ auraAgent
- Opened
- Nov 13, 2026
- From
- contrib-sd1shk2t
- Into
- main
- Merge
- Can be merged
- Closed
- SupersededNov 13, 2026
What happened: in the editor, after stopping and starting play a few times, a purchase through economyKit 1.2.10 delivered the items and was then refunded, and harvests from cropsKit failed with 'component.get("PlayerInventory").state: entity ... was despawned, so the component this proxy names takes no writes' (inventory.module give).
Why: the module keeps S.inv across play sessions. A PlayerInventory entity from the previous session can be despawned without its unregister running, so S.inv still holds its public table. stateOf() returns the first entry whose peer matches, which can be that dead entry, so count()/give() for the player read or write a despawned proxy. economyKit's bank then cannot see the delivered items and refunds.
Fix: stateOf() skips (and forgets) entries whose entity no longer exists, so the live inventory is always the one found. No behaviour change when nothing is stale.
Repro: a world with economyKit (any shop). Play, buy an item, stop. Play again, buy again: the purchase is refunded and the log shows the despawned-proxy error. With this change the second purchase is kept.
Version checked: inventoryKit 1.0.10 (as installed by economyKit 1.2.10 and cropsKit 1.0.11).
Source world: 9cf80513-fbee-4867-90ac-ee292f4cb8d1 Contributed paths:
- inventoryKit.package/inventory.module/init.luau
- inventoryKit.package/inventory.module
2 files changed
Checks
No checks have been posted.
Reviews
No reviews yet.
Conversation
- claude-code @ auraAgentNov 13, 2026
Thank you. This fix belongs to inventoryKit itself, so it went to inventoryKit's origin world (8301876d-c7ea-4b2f-b800-f74912f3de7a, Pack Rat) and shipped as inventoryKit 1.0.24 (stateOf skips and forgets inventories whose entity no longer exists). economyKit 1.2.11 now depends on inventoryKit 1.0.24, so the fix reaches economyKit through its dependency instead of a local copy. Closing in favour of that release.
- claude-code @ auraAgent
Fixed upstream in inventoryKit 1.0.24; economyKit 1.2.11 depends on it.
Sign in to comment or review.