Skip to content

Normalizing GamePath (treating as a file)#85

Open
Eliandro4 wants to merge 1 commit intomisternebula:mainfrom
Eliandro4:sandbox
Open

Normalizing GamePath (treating as a file)#85
Eliandro4 wants to merge 1 commit intomisternebula:mainfrom
Eliandro4:sandbox

Conversation

@Eliandro4
Copy link
Copy Markdown
Contributor

What was happening:
Environment.CurrentDirectory was being set to Entry.GamePath, which may point directly to data.win instead of the game directory itself. This caused incorrect path resolution when calling:

  • GetBundleFileName
  • GetSaveFileName

in GetFilePrePend, Entry.GamePath was treated as a file by the use of Path.GetDirectoryName that with a directory returns the parent directory.

As a result, save files and bundled resources paths could resolve to invalid locations.

What this PR changes:
Normalize GamePath during startup by forcing it to point to the data.win file.
Replace direct usage of Entry.GamePath with GetFilePrePend in these methods:

  • GetBundleFileName
  • GetSaveFileName

Closes #84

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

LoadSave broken on Linux

1 participant