branchrust_reboot/main/ammo_count_in_chestscancel
7 Commits over 0 Days - ∞cph!
Moved #CLIENT outside of #SERVER block to fix unload ammo menu option not showing
Merge from main -> ammo_count_in_chests
Fixed SERVER compile errors
Remove tracking every item on the server
Instead, get the ammo count from the held entity when calling Item.Save()
Merge from main -> ammo_count_in_chests
Allow unloading guns inside chests
Update ItemIcon.selectedItem before calling OnInventoryUpdated() so that menu options update when your selected item changes
Add `ammoCount` to Item and fallback to the item's ammo count when inside a chest / locker / player inventory (other than hotbar)
Track all items on the server in `ItemManager.serverItems` dictionary so the item can be updated every time the `BaseProjectile` ammo is modified (normally it only can find item when inside player inventory)
Save ammoCount in protobuf as an Int where 0 = null, 1 = 0, etc (since protobuf doesn't support nullable types)