Skip to content

Commit

Permalink
fix: Update container state for ItemRequirement on same tick (Zoinkwi…
Browse files Browse the repository at this point in the history
…z#1957)

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 and PsycloneTM committed Feb 3, 2025
1 parent aad0801 commit 7a792da
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 7a792da

Please sign in to comment.