(BF, BMD, SPD, PAK) Fix files not being emulated after initial creation#29
Merged
Sewer56 merged 1 commit intoSewer56:mainfrom Apr 21, 2025
Merged
(BF, BMD, SPD, PAK) Fix files not being emulated after initial creation#29Sewer56 merged 1 commit intoSewer56:mainfrom
Sewer56 merged 1 commit intoSewer56:mainfrom
Conversation
Owner
You're expected to use these APIs during startup in general, so I think it's fine; the chances of concurrency issues there are pretty much for the most part, 0. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This fixes a bug that's present in BF, BMD, SPD, and PAK emulators that causes files to not be emulated if they are opened more than once (only the first creation works).
This is due to us using
TryAddin the_pathToEmulatedconcurrent dictionaries that should be used to pass back the previously emulated file when a file tries to be created subsequent times. It fails if something is already in the dictionary and since we put the valuenullin to prevent recursion, we end up withnulleven after emulation succeeds.For simplicity I've just replaced
TryAddwith a direct index (dict[thing]) instead ofTryUpdatesince I don't think concurrency is really a problem right now. Maybe this is something we need to consider more at some point but I'd guess that's a bigger problem?