Remove item instance legacy ID projection

This commit is contained in:
Meta Vens 2026-06-15 02:57:50 +01:00
commit 0b92a2faae
6 changed files with 8 additions and 8 deletions

View file

@ -264,7 +264,7 @@ public abstract class Entity
Hull = hull;
var typedHull = itemManager.GetRuntimeItem(hull);
if (typedHull == null)
throw new InvalidOperationException($"Unable to construct entity: missing typed hull row for {hull?.ItemId}");
throw new InvalidOperationException($"Unable to construct entity: missing typed hull row for {hull?.ItemKey}");
Name = typedHull.Name;
MapEntity();
WeaponGroups = new (List<Weapon> weapons, List<EquippedItem> items)[itemManager.GameplaySettings.WeaponGroupCount];
@ -354,7 +354,7 @@ public abstract class Entity
{
var typedHull = ItemManager.GetRuntimeItem(Hull);
if (typedHull == null)
throw new InvalidOperationException($"Unable to map entity {Name}: missing typed hull row for {Hull?.ItemId}");
throw new InvalidOperationException($"Unable to map entity {Name}: missing typed hull row for {Hull?.ItemKey}");
var hullShape = GetHullShape(typedHull);
EquippedHull = new EquippedItem(ItemManager, Hull, int2.zero, this);

View file

@ -2,7 +2,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
@ -16,7 +15,6 @@ public abstract class ItemInstance
public ItemRotation Rotation;
public string ItemKey => Reference?.ItemKey ?? "";
public Guid ItemId => Reference?.LegacyItemId ?? Guid.Empty;
}
public abstract class CraftedItemInstance : ItemInstance

View file

@ -598,7 +598,7 @@ public class ItemManager
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 {typedItem?.Name ?? item.ItemId.ToString()} evaluating as NaN: input data is invalid! Durability: {item.Durability} / {maxDurability}");
throw new InvalidOperationException($"Performance Stat on {typedItem?.Name ?? item.ItemKey} evaluating as NaN: input data is invalid! Durability: {item.Durability} / {maxDurability}");
return result;
}
@ -647,7 +647,7 @@ public class ItemManager
var typedItem = GetRuntimeItem(item);
if (typedItem == null)
{
_logger($"Attempted to instantiate missing item id {item?.ItemId}");
_logger($"Attempted to instantiate missing item key {item?.ItemKey}");
return null;
}