Merge pull request #5 from ZaneYork/master

Modify launch args logic to enable launch renamed game
This commit is contained in:
ChrisMiuchiz 2019-10-06 11:21:52 -04:00 committed by GitHub
commit f5797ac468
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