diff --git a/src/cmdline/RootCommands.cpp b/src/cmdline/RootCommands.cpp index f9d5fce90e..446c9f7887 100644 --- a/src/cmdline/RootCommands.cpp +++ b/src/cmdline/RootCommands.cpp @@ -208,7 +208,7 @@ exitcode_t HandleCommandHost(CommandLineArgEnumerator * enumerator) const char * parkUri; if (!enumerator->TryPopString(&parkUri)) { - Console::Error::WriteLine("Expected path or URL to a saved park."); + Console::Error::WriteLine("Expected path or URL to a scenario or saved park."); return EXITCODE_FAIL; } diff --git a/src/openrct2.c b/src/openrct2.c index 940c4b8f99..87ee82cc9b 100644 --- a/src/openrct2.c +++ b/src/openrct2.c @@ -277,8 +277,9 @@ void openrct2_launch() break; case STARTUP_ACTION_OPEN: assert(gOpenRCT2StartupActionPath != NULL); - if (rct2_open_file(gOpenRCT2StartupActionPath) == 0) + if (!rct2_open_file(gOpenRCT2StartupActionPath)) { break; + } RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) = SCREEN_FLAGS_PLAYING; diff --git a/src/rct2.c b/src/rct2.c index e3071f4a27..1f56898f63 100644 --- a/src/rct2.c +++ b/src/rct2.c @@ -345,30 +345,32 @@ static void rct2_draw_fps() gfx_set_dirty_blocks(x - 16, y - 4, gLastDrawStringX + 16, 16); } -int rct2_open_file(const char *path) +bool rct2_open_file(const char *path) { char *extension = strrchr(path, '.'); - if (extension == NULL) - return 0; + if (extension == NULL) { + return false; + } extension++; if (_stricmp(extension, "sv6") == 0) { strcpy((char*)RCT2_ADDRESS_SAVED_GAMES_PATH_2, path); game_load_save(path); - return 1; + return true; } else if (_stricmp(extension, "sc6") == 0) { // TODO scenario install rct_scenario_basic scenarioBasic; strcpy(scenarioBasic.path, path); scenario_load_and_play_from_path(scenarioBasic.path); + return true; } else if (_stricmp(extension, "td6") == 0 || _stricmp(extension, "td4") == 0) { - return 1; + return true; } else if (!_stricmp(extension, "td6") || !_stricmp(extension, "td4")) { // TODO track design install - return 1; + return true; } - return 0; + return false; } /** diff --git a/src/rct2.h b/src/rct2.h index a7b40d25e8..1a5aa30746 100644 --- a/src/rct2.h +++ b/src/rct2.h @@ -275,6 +275,6 @@ int check_files_integrity(); const char *get_file_path(int pathId); void rct2_quit(); -int rct2_open_file(const char *path); +bool rct2_open_file(const char *path); #endif