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

Game exe path command line argument #713

Merged
merged 8 commits into from
Sep 11, 2024

Conversation

ToeKneeRED
Copy link
Contributor

Adds the game exe portion of #627
I am not sure how SKSE wouldn't be loaded if it is installed correctly so I will leave that for a different PR if it is necessary.

ex.
SkyrimTogether.exe --exePath C:\Path\To\Game\SkyrimSE.exe
or
SkyrimTogether.exe --exePath "C:\Path\With a space\SkyrimSE.exe"

@Force67 Force67 self-requested a review September 9, 2024 18:59
{
if (std::strcmp(aArgv[i], "-r") == 0)
aAskSelect = true;
else if (std::strcmp(aArgv[i], "--exePath") == 0)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a bit dangerous. The problem arises because there's no guarantee that aArgv[i + 1] is a valid memory location. If "--exePath" is the last argument in the command line, i + 1 would be out of bounds of the aArgv array.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be better in 50488e3
(clang formatted after)


bool PathArgument(const std::string& acPath)
{
g_exePath = std::wstring(acPath.begin(), acPath.end());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not very pretty with the global variables :(

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 0f9c6ad
(proper const naming in 79f3ba8)

@Force67 Force67 merged commit ab18db9 into tiltedphoques:dev Sep 11, 2024
1 of 2 checks passed
@ToeKneeRED ToeKneeRED deleted the feat/exePathArgument branch September 11, 2024 20:28
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.

2 participants