Skip to content

Commit

Permalink
fix: Update container state for ItemRequirement on same tick (#1957)
Browse files Browse the repository at this point in the history
This might fix an issue where an inventory change occurs on the same tick as the check occurs.

My theory is that the item added event occurs after the inventory check for an ItemRequirement on the same tick.
  • Loading branch information
Zoinkwiz authored Jan 31, 2025
1 parent bafec37 commit b2d5c64
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ public int checkTotalMatchesInContainers(Client client, ItemAndLastUpdated... co
{
totalFound += getMaxMatchingItems(client, container.getItems());
}
else if (stateForItemInContainer.getLastCheckedTick() < container.getLastUpdated())
else if (stateForItemInContainer.getLastCheckedTick() <= container.getLastUpdated())
{
int matchesInContainer = getMaxMatchingItems(client, container.getItems());
stateForItemInContainer.set(matchesInContainer, client.getTickCount());
Expand Down

0 comments on commit b2d5c64

Please sign in to comment.