Fix ghc directory iterator treating all files subsequent to a symlink as symlink #63612
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.
Summary
Bugfixes "Fix files after a symlink in a directory all treated as symlink on Windows"
Purpose of change
The game does not handle directory with symlinks in it correctly on Windows, so if a player has a symlink in their gfx directory that points to another tileset repo, none of the tilesets after that tileset will be listed in the options.
Describe the solution
Check a file is actually a reparse point before checking its reparse tag to avoid getting an undefined value. Also removed a hack that uses structure size to deteremine structure type.
Describe alternatives you've considered
Testing
All tilesets are now listed, and the game did not explode when loading a save.
Additional context
I plan to PR this patch upstream too, but for now we can include in our repo first.