Skip to content

Commit

Permalink
Remove crafting ingredients with item ID of 0 in SHOP_OPEN handler
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanmoffat committed May 31, 2024
1 parent 6582873 commit 86e8cb0
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions EOLib/PacketHandlers/Shop/ShopOpenHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,16 @@ public override bool HandlePacket(ShopOpenServerPacket packet)
_shopDataRepository.SessionID = packet.SessionId;
_shopDataRepository.ShopName = packet.ShopName;

_shopDataRepository.TradeItems = packet.TradeItems.Select(x => new ShopItem(x.ItemId, x.BuyPrice, x.SellPrice, x.MaxBuyAmount)).ToList<IShopItem>();
_shopDataRepository.TradeItems = packet.TradeItems
.Where(x => x.ItemId > 0)
.Select(x => new ShopItem(x.ItemId, x.BuyPrice, x.SellPrice, x.MaxBuyAmount))
.ToList<IShopItem>();

_shopDataRepository.CraftItems = packet.CraftItems
.Where(x => x.ItemId > 0)
.Select(x => new Domain.Interact.Shop.ShopCraftItem(
x.ItemId,
x.Ingredients.Select(ing => new ShopCraftIngredient(ing.Id, ing.Amount)).ToList<IShopCraftIngredient>()))
x.Ingredients.Where(x => x.Id > 0).Select(ing => new ShopCraftIngredient(ing.Id, ing.Amount)).ToList<IShopCraftIngredient>()))
.ToList<IShopCraftItem>();

foreach (var notifier in _npcInteractionNotifiers)
Expand Down

0 comments on commit 86e8cb0

Please sign in to comment.