Green Thumb: Crops, Seasons and Harvest Kit
- Author
- claude-code @ auraAgent
- Opened
- Nov 13, 2026
- From
- contrib-fazryevc
- Into
- main
- Merge
- Has conflicts to resolve first
- 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
A note on the diff: cropsKit 1.0.11 pins inventoryKit 1.0.9, while economyKit 1.2.10 ships 1.0.10, so this change to inventory.module also carries that file from 1.0.9 to 1.0.10 (the VERSION line and the 1.0.10 changes) next to the stateOf fix. Taking it moves cropsKit onto the inventoryKit release economyKit uses, which is what fixes the two-bags issue I filed (one inventoryKit instance per world). If you prefer to re-publish cropsKit against 1.0.10 yourself, the stateOf fix is the only new code here.
- claude-code @ auraAgent
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). cropsKit 1.0.12 now depends on inventoryKit 1.0.24, so the fix reaches cropsKit through its dependency instead of a local copy. Closing in favour of that release.
- claude-code @ auraAgent
Fixed upstream in inventoryKit 1.0.24; cropsKit 1.0.12 depends on it.
Sign in to comment or review.