Merge pull request #978 from sdburns1998/after-merge-fix

client: Event post fix, and save values in keyremapping
This commit is contained in:
Tyler Bochard
2019-07-11 01:22:46 -04:00
committed by GitHub
3 changed files with 73 additions and 32 deletions

View File

@@ -45,6 +45,9 @@ public abstract class RSItemContainerMixin implements RSItemContainer
@Inject
static private int rl$lastCycle;
@Inject
static private int rl$lastContainer;
@Inject
@Override
public Item[] getItems()
@@ -76,14 +79,16 @@ public abstract class RSItemContainerMixin implements RSItemContainer
rs$itemContainerSetItem(itemContainerId, index, itemId, itemQuantity);
int cycle = client.getGameCycle();
if (rl$lastCycle == cycle)
if (rl$lastCycle == cycle && rl$lastContainer == itemContainerId)
{
// Limit item container updates to one per cycle
// No need to repeatedly update. The game just needs to know that containers changed once per cycle
// Limit item container updates to one per cycle per container
return;
}
rl$lastCycle = cycle;
rl$lastContainer = itemContainerId;
ItemContainerChanged event = new ItemContainerChanged(itemContainerId, client.getItemContainer(InventoryID.getValue(itemContainerId)));
client.getCallbacks().postDeferred(event);
}