diff --git a/.voidbot/state/aetheria.cc b/.voidbot/state/aetheria.cc index ef9219c2c..d68945627 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 393c7c11c..0732be49e 100644 --- a/Assets/Scripts/ServerShared/ItemManager.cs +++ b/Assets/Scripts/ServerShared/ItemManager.cs @@ -177,16 +177,22 @@ public class ItemManager // Returns stat when not equipped public float Evaluate(PerformanceStat stat, EquippableItem item) { - var data = GetData(item); + var typedItem = GetRuntimeItem(item); + var maxDurability = (float)(typedItem?.Durability ?? 0); + if (maxDurability <= 0) + { + maxDurability = Math.Max(item.Durability, 1f); + } + var quality = pow(item.Quality, stat.QualityExponent); var durabilityExponent = lerp( GameplaySettings.DurabilityQualityMin, GameplaySettings.DurabilityQualityMax, pow(item.Quality, GameplaySettings.DurabilityQualityExponent)); - var durability = pow(item.Durability / data.Durability, durabilityExponent * stat.DurabilityExponentMultiplier); + var durability = pow(item.Durability / maxDurability, durabilityExponent * stat.DurabilityExponentMultiplier); var result = lerp(stat.Min, stat.Max, quality * durability); if (float.IsNaN(result)) - throw new InvalidOperationException($"Performance Stat on {data.Name} evaluating as NaN: input data is invalid! Durability: {item.Durability} / {data.Durability}"); + throw new InvalidOperationException($"Performance Stat on {typedItem?.Name ?? item.Data?.ItemId.ToString() ?? "unknown item"} evaluating as NaN: input data is invalid! Durability: {item.Durability} / {maxDurability}"); return result; } diff --git a/docs/aetheria-perfect-machine-map.md b/docs/aetheria-perfect-machine-map.md index fa220bffb..dd14f1a46 100644 --- a/docs/aetheria-perfect-machine-map.md +++ b/docs/aetheria-perfect-machine-map.md @@ -226,7 +226,9 @@ legacy catalog cache, and legacy UI paths should be migration-only or deleted. typed rows receive the generic tint instead of falling back to legacy `EquippableItemData.HardpointType`. Inventory HUD durability tint uses typed max durability only, with current runtime durability as the generic - denominator for incomplete typed rows. + denominator for incomplete typed rows. `ItemManager.Evaluate` also uses typed + runtime item max durability and item names when evaluating unequipped + performance stats. 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`. @@ -750,6 +752,9 @@ First Aetheria surfaces to publish: `Entity.UpdateTemperature` onto typed runtime hull rows. - Done: move entity default naming onto typed hull rows and delete the entity-level `HullData` property that only preserved legacy name hydration. + - 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 `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