mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-02 02:43:44 +00:00
Item::RemoveFromInventory ended with `delete this`, so every caller that still used the item afterwards (SetCount(0) returning into its caller, loops that remove several items, proxies purged while their parent is handled) touched freed memory. The inventory now takes the removed item and frees it at the inventory component's next update, or with the inventory. Check in game: sell, drop, delete, trade, mail and use up stacks (including the last of a stack); unequip and remove an item set piece and a proxy-bearing item (rocket, modular car); donate items; nothing crashes and the inventory shows the right counts after relogging. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>