Skip to content

Commit

Permalink
Reduce number of inventory items updated to only items with changed a…
Browse files Browse the repository at this point in the history
…mounts
  • Loading branch information
ethanmoffat committed Mar 29, 2022
1 parent 97dfc6c commit 4023c43
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion EndlessClient/HUD/Panels/InventoryPanel.cs
Expand Up @@ -160,7 +160,8 @@ protected override void OnUpdateControl(GameTime gameTime)
{
var added = _characterInventoryProvider.ItemInventory.Where(i => !_cachedInventory.Any(j => i.ItemID == j.ItemID));
var removed = _cachedInventory.Where(i => !_characterInventoryProvider.ItemInventory.Any(j => i.ItemID == j.ItemID));
var updated = _characterInventoryProvider.ItemInventory.Except(added);
var updated = _characterInventoryProvider.ItemInventory.Except(added)
.Where(i => _cachedInventory.Any(j => i.ItemID == j.ItemID && i.Amount != j.Amount));

foreach (var item in removed)
{
Expand Down

0 comments on commit 4023c43

Please sign in to comment.