Fix TiltedPhoques::GetPath() to persist the correct path #12
+13
−7
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.
There were a couple of issues with the way it was doing it. The attempt to reference __ImageBase wasn't working, so it was effectively NULL.
And NULL could stop working (and __ImageBase can change) once SkyrimSE.exe was loaded because the GetModuleFileName() spoofing in SkyrimTogether was not robust; it isn't possible to reliably determine if base STR is asking (vs. the game exe or a mod) in the face of multiple different hook systems.
The bug was once things are running a mod or Skyrim could actually get the SkyrimTogether path. The best fix was to have SkyrimTogether turn on spoofing when it is about to load the .exe. But that would cause late-loading parts of STR, like the UI / Cef, to get a Skyrim path when it wanted a STR path.
Best fix is for TiltedPhoques::GetPath() to persist the correct path it gets early. That enables a simple fix for when GetModuleFileName*() should spoof, so both SkyrimTogether and {SkyrimSE, mods} get the answer they expect, reliably.
Please tag v0.2.8 so we can update xmake-repo