Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing current working directory on startup #1047

Merged
merged 5 commits into from
Sep 10, 2024
Merged

Conversation

iliasHDZ
Copy link
Contributor

@iliasHDZ iliasHDZ commented Aug 20, 2024

The game crashes if launched from command prompt from a directory other than the game's directory.
This should fix the CWD back to the GD directory.

I need this so I can easily run GD from a batch script after compiling my mod.

@matcool
Copy link
Member

matcool commented Aug 20, 2024

this will likely break on unicode paths due to the usage of the A winapi functions

@iliasHDZ
Copy link
Contributor Author

So I fixed it. Will this be checked soon?

loader/src/platform/windows/main.cpp Outdated Show resolved Hide resolved
loader/src/platform/windows/main.cpp Outdated Show resolved Hide resolved
loader/src/platform/windows/main.cpp Outdated Show resolved Hide resolved
@iliasHDZ
Copy link
Contributor Author

Ok, it now uses std::array. I also fixed some cases where for example there is no slashes, it will return.

@altalk23 altalk23 merged commit 7c558ee into geode-sdk:main Sep 10, 2024
4 checks passed
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.

3 participants