Pokemon Emerald: Temporary fix for missing items #3162
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What is this fixing or adding?
Adds a delay to the client's game watcher loop if the client has to update its item handling. If the response from the server that includes a player's own items doesn't come before the watcher starts giving the player items, they may be receiving the wrong items and some of the items they should have received may be skipped.
Bug is more likely to occur in the middle of an async when the player reconnects after many items have been found, and is more likely to skip items if there are many players, since the Emerald player is unlikely to find items for themselves.
The actual fix is to add the information into the patch file and read it before sending the first
Connect
, but I don't have a place for it yet. That change will be made when the patch is next updated.How was this tested?
Opened a patch using
remote_items
with the client and received a few items. Wasn't able to reproduce the issue, but this fix is only adding a safety buffer to avoid a race condition anyway.