Preserve entity item facts in typed snapshots

This commit is contained in:
Meta Vens 2026-06-14 15:23:38 +01:00
commit 2907cdd801
8 changed files with 62 additions and 8 deletions

View file

@ -191,11 +191,22 @@ public static class AetheriaRuntimeCommitLogApplier
private static AetheriaEntityItemSlot[] ToEntityItemSlots(
IReadOnlyList<AetheriaRuntimeLoadoutItemSlotCommit>? slots)
{
return ToItemSlots(slots)
.Select(slot => new AetheriaEntityItemSlot
return (slots ?? Array.Empty<AetheriaRuntimeLoadoutItemSlotCommit>())
.Select(slot =>
{
Position = slot.Position,
ItemKey = slot.Item.ItemKey
var item = ToLoadoutItem(slot.Item);
return new AetheriaEntityItemSlot
{
Position = new AetheriaGridCoord
{
X = slot.X,
Y = slot.Y
},
ItemKey = item.ItemKey,
Quality = item.Quality,
Durability = item.Durability,
Quantity = item.Quantity
};
})
.ToArray();
}