Minor code edit on main.cpp.

This commit is contained in:
NovaRain
2018-12-17 09:44:36 +08:00
parent 90b39f3dde
commit dea0e596c3
2 changed files with 6 additions and 7 deletions
+1 -1
View File
@@ -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.
+4 -5
View File
@@ -68,7 +68,7 @@ ddrawDll ddraw;
bool IsDebug = false;
char ini[65];
char ini[65] = ".\\";
char translationIni[65];
static char mapName[65];
@@ -1673,12 +1673,11 @@ 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);
strcpy_s(ini, ".\\ddraw.ini");