From dea0e596c3e6a6f3f9f4583f06264dd3253d17a4 Mon Sep 17 00:00:00 2001 From: NovaRain Date: Mon, 17 Dec 2018 09:44:36 +0800 Subject: [PATCH] Minor code edit on main.cpp. --- artifacts/ddraw.ini | 2 +- sfall/main.cpp | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/artifacts/ddraw.ini b/artifacts/ddraw.ini index f94fb1df..94368a19 100644 --- a/artifacts/ddraw.ini +++ b/artifacts/ddraw.ini @@ -450,7 +450,7 @@ ScienceOnCritters=0 SpeedInventoryPCRotation=166 ;Uncomment to set the text colour of the extra 5 interface boxes -;The line must contain a 5 digits, each either a 0 for green or 1 for red +;The line must contain 5 digits, each either a 0 for green or 1 for red ;BoxBarColours=00000 ;Set to 1 to fix the bug that caused bonus HtH damage to not be applied correctly. diff --git a/sfall/main.cpp b/sfall/main.cpp index 572b354d..47a5ad92 100644 --- a/sfall/main.cpp +++ b/sfall/main.cpp @@ -68,7 +68,7 @@ ddrawDll ddraw; bool IsDebug = false; -char ini[65]; +char ini[65] = ".\\"; char translationIni[65]; static char mapName[65]; @@ -1673,14 +1673,13 @@ bool _stdcall DllMain(HANDLE hDllHandle, DWORD dwReason, LPVOID lpreserved) { } if (cmdlineexists && strlen(cmdline)) { - strcpy_s(ini, ".\\"); - strcat_s(ini, cmdline); HANDLE h = CreateFileA(cmdline, GENERIC_READ, 0, 0, OPEN_EXISTING, 0, 0); - if (h != INVALID_HANDLE_VALUE) + if (h != INVALID_HANDLE_VALUE) { CloseHandle(h); - else { + strcat_s(ini, cmdline); + } else { MessageBox(0, "You gave a command line argument to fallout, but it couldn't be matched to a file\n" \ - "Using default ddraw.ini instead", "Warning", MB_TASKMODAL); + "Using default ddraw.ini instead", "Warning", MB_TASKMODAL); strcpy_s(ini, ".\\ddraw.ini"); } } else {