Commit 5ae93809 authored by DailyShana's avatar DailyShana

fix

parent 769b3ca9
......@@ -120,37 +120,46 @@ int main(int argc, char* argv[]) {
bool keep_on_return = false;
for(int i = 1; i < argc; ++i) {
if(argv[i][0] == '-' && argv[i][1] == 'e') {
if(argv[i][0] == '-' && argv[i][1] == 'e' && argv[i][2]) {
ygo::dataManager.LoadDB(&argv[i][2]);
continue;
}
if(!strcmp(argv[i], "-e")) { // extra database
++i;
if(i < argc)
ygo::dataManager.LoadDB(&argv[i][0]);
continue;
} else if(!strcmp(argv[i], "-n")) { // nickName
++i;
if(i < argc) {
wchar_t param[128];
GetParameterW(param, &argv[i][0]);
ygo::mainGame->ebNickName->setText(param);
}
continue;
} else if(!strcmp(argv[i], "-h")) { // Host address
++i;
if(i < argc) {
wchar_t param[128];
GetParameterW(param, &argv[i][0]);
ygo::mainGame->ebJoinHost->setText(param);
}
continue;
} else if(!strcmp(argv[i], "-p")) { // host Port
++i;
if(i < argc) {
wchar_t param[128];
GetParameterW(param, &argv[i][0]);
ygo::mainGame->ebJoinPort->setText(param);
}
continue;
} else if(!strcmp(argv[i], "-w")) { // host passWord
++i;
if(i < argc) {
wchar_t param[128];
GetParameterW(param, &argv[i][0]);
ygo::mainGame->ebJoinPass->setText(param);
}
continue;
} else if(!strcmp(argv[i], "-k")) { // Keep on return
exit_on_return = false;
......@@ -162,7 +171,7 @@ int main(int argc, char* argv[]) {
continue;
} else { // open deck
exit_on_return = !keep_on_return;
if(i < argc) {
if(i + 1 < argc) {
open_file = true;
GetParameterW(open_file_name, &argv[i + 1][0]);
}
......@@ -181,7 +190,7 @@ int main(int argc, char* argv[]) {
break;
} else if(!strcmp(argv[i], "-r")) { // Replay
exit_on_return = !keep_on_return;
if(i < argc) {
if(i + 1 < argc) {
open_file = true;
GetParameterW(open_file_name, &argv[i + 1][0]);
}
......@@ -191,7 +200,7 @@ int main(int argc, char* argv[]) {
break;
} else if(!strcmp(argv[i], "-s")) { // Single
exit_on_return = !keep_on_return;
if(i < argc) {
if(i + 1 < argc) {
open_file = true;
GetParameterW(open_file_name, &argv[i + 1][0]);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment