From 39ba7b3fd44cccd0c2297ae7b924469b6d75c7f3 Mon Sep 17 00:00:00 2001 From: Kamron Batman <3953314+kamronbatman@users.noreply.github.com> Date: Thu, 9 May 2024 16:52:13 -0700 Subject: [PATCH] fix: Fixes dirty tracking for player vendors (#1769) --- Projects/UOContent/Mobiles/Vendors/PlayerVendor.cs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/Projects/UOContent/Mobiles/Vendors/PlayerVendor.cs b/Projects/UOContent/Mobiles/Vendors/PlayerVendor.cs index 0b7f1ed1f..b8a304b6d 100644 --- a/Projects/UOContent/Mobiles/Vendors/PlayerVendor.cs +++ b/Projects/UOContent/Mobiles/Vendors/PlayerVendor.cs @@ -401,11 +401,7 @@ public partial class PlayerVendor : Mobile } } - public VendorItem GetVendorItem(Item item) - { - _sellItems.TryGetValue(item, out var v); - return v; - } + public VendorItem GetVendorItem(Item item) => _sellItems.GetValueOrDefault(item); private VendorItem SetVendorItem(Item item, int price, string description) => SetVendorItem(item, price, description, Core.Now); @@ -415,7 +411,7 @@ public partial class PlayerVendor : Mobile RemoveVendorItem(item); var vi = new VendorItem(item, price, description, created); - _sellItems[item] = vi; + ReplaceInSellItems(item, vi); item.InvalidateProperties(); @@ -429,7 +425,7 @@ public partial class PlayerVendor : Mobile if (vi != null) { vi.Invalidate(); - _sellItems.Remove(item); + RemoveFromSellItems(item); foreach (var subItem in item.Items) {