diff --git a/.voidbot/state/aetheria.cc b/.voidbot/state/aetheria.cc index abd2372b1..04673968e 100644 Binary files a/.voidbot/state/aetheria.cc and b/.voidbot/state/aetheria.cc differ diff --git a/Assets/Scripts/ServerShared/Agents/Tasks/HaulingTask.cs b/Assets/Scripts/ServerShared/Agents/Tasks/HaulingTask.cs index 38b893fc9..4bdd6eca6 100644 --- a/Assets/Scripts/ServerShared/Agents/Tasks/HaulingTask.cs +++ b/Assets/Scripts/ServerShared/Agents/Tasks/HaulingTask.cs @@ -2,8 +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; - public class HaulingTask : AgentTask { public override TaskType Type => TaskType.Haul; @@ -12,7 +10,7 @@ public class HaulingTask : AgentTask public Entity Target; - public Guid ItemType; + public string ItemKey; public int Quantity; } diff --git a/Assets/Scripts/ServerShared/Entity.cs b/Assets/Scripts/ServerShared/Entity.cs index a3b56c0a1..d8b159b6e 100644 --- a/Assets/Scripts/ServerShared/Entity.cs +++ b/Assets/Scripts/ServerShared/Entity.cs @@ -404,7 +404,7 @@ public abstract class Entity public void GenerateWeaponGroups() { foreach (var group in Weapons - .GroupBy(w => w.Item.EquippableItem.ItemId) + .GroupBy(w => w.Item.EquippableItem.ItemKey) .OrderBy(wg=>wg.Average(w=>w.Range)) .Select((weapons, index) => (weapons, index))) { diff --git a/Assets/Scripts/ServerShared/LoadoutGenerator.cs b/Assets/Scripts/ServerShared/LoadoutGenerator.cs index d0eac04f5..045ebbe57 100644 --- a/Assets/Scripts/ServerShared/LoadoutGenerator.cs +++ b/Assets/Scripts/ServerShared/LoadoutGenerator.cs @@ -336,9 +336,7 @@ public class LoadoutGenerator var itemRow = previousItems.FirstOrDefault(i => FitsHardpoint(i, hardpoint)); var previousItem = itemRow == null ? null - : Guid.TryParse(itemRow.LegacyId, out var previousItemId) - ? entity.Equipment.FirstOrDefault(item => item.EquippableItem.ItemId == previousItemId) - : null; + : entity.Equipment.FirstOrDefault(item => item.EquippableItem.ItemKey == itemRow.ItemKey); itemRow ??= RandomCatalogItem(RuntimeItemCandidateKind.Gear, hardpoint, 2); if (itemRow == null) ItemManager.Log($"No compatible item found for entity {hardpoint.Type} hardpoint!"); else diff --git a/docs/aetheria-perfect-machine-map.md b/docs/aetheria-perfect-machine-map.md index 88dba9479..abaee19fd 100644 --- a/docs/aetheria-perfect-machine-map.md +++ b/docs/aetheria-perfect-machine-map.md @@ -1349,6 +1349,9 @@ First Aetheria surfaces to publish: Unity gameplay, HUD, inventory, trade, ship, and zone helper lookups off `ItemId`/`FindItemByLegacyId` detours. Legacy item lookup remains only as a catalog/migration compatibility API. + - Done: move server-shared weapon grouping, generated loadout previous-item + reuse, and hauling task item target identity off derived item GUIDs and + onto typed `ItemKey` strings. - Done: delete the dead `ItemManager.GetRuntimeItemProjection` bridge after loadout generation stopped hydrating selected typed rows into `EquippableItemData` merely to instantiate equipment.