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:
@@ -52,6 +52,7 @@ public class ItemStackAction
|
|||||||
foreach (var jewel in jewels)
|
foreach (var jewel in jewels)
|
||||||
{
|
{
|
||||||
await player.Inventory.RemoveItemAsync(jewel).ConfigureAwait(false);
|
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);
|
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.Inventory.RemoveItemAsync(stacked).ConfigureAwait(false);
|
||||||
|
await player.PersistenceContext.DeleteAsync(stacked).ConfigureAwait(false);
|
||||||
await player.InvokeViewPlugInAsync<IItemRemovedPlugIn>(p => p.RemoveItemAsync(slot)).ConfigureAwait(false);
|
await player.InvokeViewPlugInAsync<IItemRemovedPlugIn>(p => p.RemoveItemAsync(slot)).ConfigureAwait(false);
|
||||||
foreach (var freeSlot in freeSlots)
|
foreach (var freeSlot in freeSlots)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -63,6 +63,7 @@ public class SellItemToNpcAction
|
|||||||
{
|
{
|
||||||
player.Logger.LogDebug("Sold Item {0} for price: {1}", item, sellingPrice);
|
player.Logger.LogDebug("Sold Item {0} for price: {1}", item, sellingPrice);
|
||||||
await player.Inventory!.RemoveItemAsync(item).ConfigureAwait(false);
|
await player.Inventory!.RemoveItemAsync(item).ConfigureAwait(false);
|
||||||
|
await player.PersistenceContext.DeleteAsync(item).ConfigureAwait(false);
|
||||||
await player.InvokeViewPlugInAsync<IItemSoldToNpcPlugIn>(p => p.ItemSoldToNpcAsync(true)).ConfigureAwait(false);
|
await player.InvokeViewPlugInAsync<IItemSoldToNpcPlugIn>(p => p.ItemSoldToNpcAsync(true)).ConfigureAwait(false);
|
||||||
|
|
||||||
player.GameContext.PlugInManager.GetPlugInPoint<IItemSoldToMerchantPlugIn>()?.ItemSold(player, item, player.OpenedNpc!);
|
player.GameContext.PlugInManager.GetPlugInPoint<IItemSoldToMerchantPlugIn>()?.ItemSold(player, item, player.OpenedNpc!);
|
||||||
|
|||||||
Reference in New Issue
Block a user