diff --git a/AscNet.GameServer/Handlers/EquipModule.cs b/AscNet.GameServer/Handlers/EquipModule.cs index 42c9a1e6..fb6ba9ad 100644 --- a/AscNet.GameServer/Handlers/EquipModule.cs +++ b/AscNet.GameServer/Handlers/EquipModule.cs @@ -85,8 +85,8 @@ namespace AscNet.GameServer.Handlers public class EquipLevelUpRequest { public int EquipId; - public Dictionary UseItems; - public List UseEquipIdList; + public Dictionary? UseItems; + public List? UseEquipIdList; } [MessagePackObject(true)] @@ -109,7 +109,7 @@ namespace AscNet.GameServer.Handlers NotifyItemDataList notifyItemData = new(); int totalExp = 0; int totalCost = 0; - foreach (var item in request.UseItems) + foreach (var item in request.UseItems ?? []) { ItemTable? itemTable = TableReaderV2.Parse().FirstOrDefault(x => x.Id == item.Key); if (itemTable is not null) @@ -121,6 +121,12 @@ namespace AscNet.GameServer.Handlers } } + // TODO: Handle equip enchantment with equip cost + /*foreach (var costEquipId in request.UseEquipIdList ?? []) + { + + }*/ + notifyItemData.ItemDataList.Add(session.inventory.Do(Inventory.Coin, totalCost * -1)); session.SendPush(notifyItemData);