diff --git a/.voidbot/state/aetheria.cc b/.voidbot/state/aetheria.cc index e334b093a..150ed9acc 100644 Binary files a/.voidbot/state/aetheria.cc and b/.voidbot/state/aetheria.cc differ diff --git a/Assets/Scripts/ServerShared/ItemManager.cs b/Assets/Scripts/ServerShared/ItemManager.cs index 0732be49e..187acbc18 100644 --- a/Assets/Scripts/ServerShared/ItemManager.cs +++ b/Assets/Scripts/ServerShared/ItemManager.cs @@ -262,7 +262,7 @@ public class ItemManager { return new EquippableItem { - Data = CreateReference(item), Quality = quality, Durability = equippableItemData.Durability + Data = CreateReference(item), Quality = quality, Durability = GetInitialDurability(equippableItemData) }; } @@ -273,6 +273,12 @@ public class ItemManager }; return newCommodity; } + + private float GetInitialDurability(EquippableItemData item) + { + var typedItem = GetRuntimeItem(item.ID); + return typedItem?.Durability > 0 ? (float)typedItem.Durability : item.Durability; + } public CraftedItemInstance CreateInstance(CraftedItemData item) { diff --git a/docs/aetheria-perfect-machine-map.md b/docs/aetheria-perfect-machine-map.md index e635a12ee..c52435254 100644 --- a/docs/aetheria-perfect-machine-map.md +++ b/docs/aetheria-perfect-machine-map.md @@ -230,7 +230,9 @@ legacy catalog cache, and legacy UI paths should be migration-only or deleted. max durability only, with current runtime durability as the generic denominator for incomplete typed rows. `ItemManager.Evaluate` also uses typed runtime item max durability and item names when evaluating unequipped - performance stats. + performance stats. `ItemManager.CreateInstance(CraftedItemData, float)` + initializes new equippable runtime durability from the typed runtime item row; + `EquippableItemData.Durability` is only an incomplete-row fallback. Inventory drag preview occupancy now projects typed item shape cells only into the local `Shape` grid, and final fit/equip acceptance shares the typed runtime catalog geometry path in `Entity.ItemFits` and `TryEquip`. @@ -759,6 +761,9 @@ First Aetheria surfaces to publish: - Done: move unequipped `ItemManager.Evaluate` durability/name inputs onto typed runtime item rows; legacy `EquippableItemData.Durability` no longer owns that stat-evaluation path. + - Done: move new equippable instance durability initialization onto typed + runtime item rows; legacy `EquippableItemData.Durability` remains only as + an incomplete-row fallback in the instantiation bridge. - Done: move `Ship` drag, combat/turret predicted shot height, and thruster torque geometry onto typed hull facets and typed shape masks. - Done: delete the console `give` command instead of preserving a debug