TrolLogWeapon.GrabLog gave the picked-up log an out-of-bounds grid position ((99, 99)) to keep it off the visible inventory grid. InventoryGrid.UpdateGui maps every item to a cell with y * width + x and no bounds check, so that position threw ArgumentOutOfRangeException every frame the inventory screen was open - for the player holding it, or anyone else who ever had it in their own pack or a chest. Visible as endless console spam, a frame stall/freeze, and corrupted icons on every other slot for the rest of that update. Now uses Inventory.FindEmptySlot like every other picked-up item, so it renders in a real slot with the normal equipped indicator. Also adds InventoryGridSafetyPatch as a general safety net: any item already sitting at an invalid grid position (existing saves from before this fix, or one handed off through a chest) gets moved to a real slot - or dropped if there's no room - instead of crashing the grid the next time it renders. |
||
|---|---|---|
| .. | ||
| TMPDebug.cs | ||
| TrolClearFoodPatch.cs | ||
| TrolConfig.cs | ||
| TrolDamagePatches.cs | ||
| TrolExtraFoodUI.cs | ||
| TrolFarmingPatches.cs | ||
| TrolFoodDebug.cs | ||
| TrolFoodDebugUI.cs | ||
| TrolFoodManager.cs | ||
| TrolFoodPatches.cs | ||
| TrolLogWeapon.cs | ||
| TrolPatches.cs | ||
| TrolRace.cs | ||
| TrolRegenPatches.cs | ||
| TrolSkillPatches.cs | ||
| TrolStatusEffects.cs | ||
| TrolTotem.cs | ||
| TrolTotemBehaviour.cs | ||
| TrolTotemStore.cs | ||