William Borman main/Item Management/#3261 5:43 AM
Various refactoring to alleviate issues with items and ItemContainers. Still needs proper testing so this commit likely has bugs. Includes:
- Added differentiation between TAKING from ItemContainer and FINDING (getting info) in inventory.
- Fixed: ItemContainer's Find method was removing inventory items if the stack had to be split.
- Added protection for items containing more than maxAmount or less than 1.
- Fixed: Guns allowed items with 0 amount, where nothing else allowed below 1.
- New helper methods in ItemEx for consolidating items into stacks.
- New helper method in ItemEx for creating any amount of an item, respecting maxAmount and creating multiple if needed.
- Added warning in ItemManager if CreateItem is called with an amount > maxAmount, causing the amount to be clamped.
- Removed old methods in Item that did nothing or were unused.