diff --git a/src/common/Edelstein.Common.Gameplay/Entities/Inventories/Modifiers/ModifyInventoryContext.cs b/src/common/Edelstein.Common.Gameplay/Entities/Inventories/Modifiers/ModifyInventoryContext.cs index 82c17482..05ce14e1 100644 --- a/src/common/Edelstein.Common.Gameplay/Entities/Inventories/Modifiers/ModifyInventoryContext.cs +++ b/src/common/Edelstein.Common.Gameplay/Entities/Inventories/Modifiers/ModifyInventoryContext.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Collections.Immutable; using System.Linq; +using Edelstein.Protocol.Gameplay.Constants; using Edelstein.Protocol.Gameplay.Entities.Inventories; using Edelstein.Protocol.Gameplay.Entities.Inventories.Modifiers; using Edelstein.Protocol.Gameplay.Entities.Inventories.Modifiers.Operations; diff --git a/src/protocol/Edelstein.Protocol.Gameplay/Entities/Inventories/ItemSlotBaseExtensions.cs b/src/protocol/Edelstein.Protocol.Gameplay/Entities/Inventories/ItemSlotBaseExtensions.cs index e47e165f..5485b470 100644 --- a/src/protocol/Edelstein.Protocol.Gameplay/Entities/Inventories/ItemSlotBaseExtensions.cs +++ b/src/protocol/Edelstein.Protocol.Gameplay/Entities/Inventories/ItemSlotBaseExtensions.cs @@ -1,4 +1,5 @@ using System; +using Edelstein.Protocol.Gameplay.Constants; using Edelstein.Protocol.Network.Packets.Types; namespace Edelstein.Protocol.Gameplay.Entities.Inventories; @@ -65,7 +66,8 @@ public static StructuredItemSlot ToStructured(this ItemSlotBase item) Number = bundle.Number, Title = new LPString(bundle.Title ?? ""), - Attribute = bundle.Attribute + Attribute = bundle.Attribute, + SN = bundle.TemplateID.IsRechargeableItem() ? 0 : null }, ItemSlotPet pet => new StructuredItemSlotInfoPet { diff --git a/src/protocol/Edelstein.Protocol.Gameplay/Entities/Inventories/ItemSlotBundle.cs b/src/protocol/Edelstein.Protocol.Gameplay/Entities/Inventories/ItemSlotBundle.cs index 3973dea3..2436d7d6 100644 --- a/src/protocol/Edelstein.Protocol.Gameplay/Entities/Inventories/ItemSlotBundle.cs +++ b/src/protocol/Edelstein.Protocol.Gameplay/Entities/Inventories/ItemSlotBundle.cs @@ -1,4 +1,6 @@ -namespace Edelstein.Protocol.Gameplay.Entities.Inventories; +using Edelstein.Protocol.Gameplay.Constants; + +namespace Edelstein.Protocol.Gameplay.Entities.Inventories; public record ItemSlotBundle : ItemSlotBase { @@ -8,7 +10,8 @@ public record ItemSlotBundle : ItemSlotBase public string? Title { get; set; } public bool IsMergeableWith(ItemSlotBundle bundle) - => TemplateID == bundle.TemplateID && + => !TemplateID.IsRechargeableItem() && + TemplateID == bundle.TemplateID && Attribute == bundle.Attribute && Title == bundle.Title && DateExpire == bundle.DateExpire; diff --git a/src/protocol/Edelstein.Protocol.Gameplay/Entities/Inventories/StructuredItemSlotInfoBundle.cs b/src/protocol/Edelstein.Protocol.Gameplay/Entities/Inventories/StructuredItemSlotInfoBundle.cs index 0613e564..196b8848 100644 --- a/src/protocol/Edelstein.Protocol.Gameplay/Entities/Inventories/StructuredItemSlotInfoBundle.cs +++ b/src/protocol/Edelstein.Protocol.Gameplay/Entities/Inventories/StructuredItemSlotInfoBundle.cs @@ -1,4 +1,5 @@ using BinarySerialization; +using Edelstein.Protocol.Gameplay.Constants; using Edelstein.Protocol.Network.Packets.Types; namespace Edelstein.Protocol.Gameplay.Entities.Inventories; @@ -8,5 +9,7 @@ public record StructuredItemSlotInfoBundle : StructuredItemSlotInfoBase [FieldOrder(0)] public short Number { get; init; } [FieldOrder(1)] public LPString Title { get; init; } = new(); [FieldOrder(2)] public short Attribute { get; init; } - [FieldOrder(3)] public long? SN { get; init; } + + [FieldOrder(3)] + public long? SN { get; init; } }