diff --git a/Maple2.Server.Game/Manager/Items/InventoryManager.cs b/Maple2.Server.Game/Manager/Items/InventoryManager.cs index 531d1bc8a..ceceec518 100644 --- a/Maple2.Server.Game/Manager/Items/InventoryManager.cs +++ b/Maple2.Server.Game/Manager/Items/InventoryManager.cs @@ -200,8 +200,7 @@ public bool Add(Item add, bool notifyNew = false, bool commit = false) { add.Transfer?.Bind(session.Player.Value.Character); } - bool stack = !(add.ExpiryTime > 0); - IList<(Item, int Added)> result = items.Add(add, stack); + IList<(Item, int Added)> result = items.Add(add, stack: true); if (result.Count == 0) { session.Send(ItemInventoryPacket.Error(s_err_inventory)); return false; diff --git a/Maple2.Server.Game/Manager/Items/ItemCollection.cs b/Maple2.Server.Game/Manager/Items/ItemCollection.cs index 94d700289..b4bc67f7f 100644 --- a/Maple2.Server.Game/Manager/Items/ItemCollection.cs +++ b/Maple2.Server.Game/Manager/Items/ItemCollection.cs @@ -143,7 +143,7 @@ private bool Append(Item insert) { // Prefer item slot if specified if (ValidSlot(add.Slot) && this[add.Slot] == null) { this[add.Slot] = add; - return new[] { (add, add.Amount) }; + return [(add, add.Amount)]; } IList<(Item, int Added)> result = new List<(Item, int)>(); @@ -318,7 +318,8 @@ private static bool CanStack(Item item, Item stack) { return item.Id == stack.Id && item.Rarity == stack.Rarity && item.Amount < item.Metadata.Property.SlotMax - && Equals(item.Transfer, stack.Transfer); + && Equals(item.Transfer, stack.Transfer) + && item.ExpiryTime / 60 == stack.ExpiryTime / 60; // Expiry time is in seconds, convert to minutes } private static int SortItem(Item? x, Item? y) {