-
Notifications
You must be signed in to change notification settings - Fork 226
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
Conversation
ex. `SkyrimTogether.exe --exePath C:\Path\To\Game\SkyrimSE.exe`
{ | ||
if (std::strcmp(aArgv[i], "-r") == 0) | ||
aAskSelect = true; | ||
else if (std::strcmp(aArgv[i], "--exePath") == 0) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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()); |
There was a problem hiding this comment.
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 :(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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"