Update main.cpp

This commit is contained in:
Zane.Y 2019-10-06 10:40:58 +08:00 committed by GitHub
parent 098fd15371
commit 11cb2725b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 2 deletions

View File

@ -11,11 +11,11 @@
#define MODLOADER_CRC 0x39D18E98 #define MODLOADER_CRC 0x39D18E98
#define CUBE_EXECUTABLE "cubeworld.exe" char* CUBE_EXECUTABLE = "cubeworld.exe";
using namespace std; using namespace std;
bool FileExists(const char* fileName) { bool FileExists(char* fileName) {
DWORD dwAttrib = GetFileAttributes(fileName); DWORD dwAttrib = GetFileAttributes(fileName);
return (dwAttrib != INVALID_FILE_ATTRIBUTES && !(dwAttrib & FILE_ATTRIBUTE_DIRECTORY)); return (dwAttrib != INVALID_FILE_ATTRIBUTES && !(dwAttrib & FILE_ATTRIBUTE_DIRECTORY));
} }
@ -31,6 +31,9 @@ int main(int argc, char** argv) {
if (argc >= 2 && !strcmp(argv[1], "test")) { if (argc >= 2 && !strcmp(argv[1], "test")) {
testMode = true; testMode = true;
printf("Test mode enabled. CRC checks will be bypassed.\n"); printf("Test mode enabled. CRC checks will be bypassed.\n");
if (argc >= 3) {
CUBE_EXECUTABLE = argv[2];
}
} }
//Cube world is obviously required //Cube world is obviously required