Merge pull request #835 from nolt/fix-item-row-leak

Delete item rows when items leave the game

(cherry picked from commit c5eb47f03e726fc300fae352487622b79337911d)
This commit is contained in:
sven-n
2026-07-21 08:00:55 +02:00
committed by Acentech Dev
parent dee0e014b1
commit 93050d5276
2 changed files with 3 additions and 0 deletions

View File

@@ -52,6 +52,7 @@ public class ItemStackAction
foreach (var jewel in jewels)
{
await player.Inventory.RemoveItemAsync(jewel).ConfigureAwait(false);
await player.PersistenceContext.DeleteAsync(jewel).ConfigureAwait(false);
await player.InvokeViewPlugInAsync<IItemRemovedPlugIn>(p => p.RemoveItemAsync(jewel.ItemSlot)).ConfigureAwait(false);
}
@@ -118,6 +119,7 @@ public class ItemStackAction
}
await player.Inventory.RemoveItemAsync(stacked).ConfigureAwait(false);
await player.PersistenceContext.DeleteAsync(stacked).ConfigureAwait(false);
await player.InvokeViewPlugInAsync<IItemRemovedPlugIn>(p => p.RemoveItemAsync(slot)).ConfigureAwait(false);
foreach (var freeSlot in freeSlots)
{

View File

@@ -63,6 +63,7 @@ public class SellItemToNpcAction
{
player.Logger.LogDebug("Sold Item {0} for price: {1}", item, sellingPrice);
await player.Inventory!.RemoveItemAsync(item).ConfigureAwait(false);
await player.PersistenceContext.DeleteAsync(item).ConfigureAwait(false);
await player.InvokeViewPlugInAsync<IItemSoldToNpcPlugIn>(p => p.ItemSoldToNpcAsync(true)).ConfigureAwait(false);
player.GameContext.PlugInManager.GetPlugInPoint<IItemSoldToMerchantPlugIn>()?.ItemSold(player, item, player.OpenedNpc!);