Skip to content

Commit

Permalink
ground items: invalidate item cache when quantity changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam- committed Mar 22, 2024
1 parent 5aa9ca4 commit cb26f81
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -259,13 +259,11 @@ public void onItemSpawned(ItemSpawned itemSpawned)
{
existing.setQuantity(existing.getQuantity() + groundItem.getQuantity());
// The spawn time remains set at the oldest spawn

updateItemColor(existing);
existing.reset();
}
else
{
collectedGroundItems.put(tile.getWorldLocation(), item.getId(), groundItem);
updateItemColor(groundItem);
}

if (!config.onlyShowLoot())
Expand Down Expand Up @@ -314,6 +312,7 @@ public void onItemDespawned(ItemDespawned itemDespawned)
// it is not known which item is picked up, so we invalidate the spawn
// time
groundItem.setSpawnTime(null);
groundItem.reset();
}

handleLootbeam(tile.getWorldLocation());
Expand Down

0 comments on commit cb26f81

Please sign in to comment.