From 55dcef13adc9d7bbc59cb13fa24c68c8153e1454 Mon Sep 17 00:00:00 2001 From: IntelOrca Date: Fri, 6 Feb 2015 23:15:11 +0000 Subject: [PATCH] ensure only g1.dat exists, also allow title screen scenario to not exist --- src/rct2.c | 29 +++++++++++------------------ src/title.c | 9 +++++---- 2 files changed, 16 insertions(+), 22 deletions(-) diff --git a/src/rct2.c b/src/rct2.c index 54f1050074..aefa510193 100644 --- a/src/rct2.c +++ b/src/rct2.c @@ -252,24 +252,7 @@ int check_file_path(int pathId) HANDLE file = CreateFile(path, FILE_GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_RANDOM_ACCESS, NULL); switch (pathId) { - case PATH_ID_GAMECFG: - case PATH_ID_SCORES: - case PATH_ID_TRACKSIDX: - case PATH_ID_PLUGIN: - // Do nothing; these will be created later if they do not exist yet - break; - - case PATH_ID_CUSTOM1: - if (file != INVALID_HANDLE_VALUE) - RCT2_GLOBAL(0x009AF164, unsigned int) = SetFilePointer(file, 0, 0, FILE_END); // Store file size in music_custom1_size @ 0x009AF164 - break; - - case PATH_ID_CUSTOM2: - if (file != INVALID_HANDLE_VALUE) - RCT2_GLOBAL(0x009AF16E, unsigned int) = SetFilePointer(file, 0, 0, FILE_END); // Store file size in music_custom2_size @ 0x009AF16E - break; - - default: + case PATH_ID_G1: if (file == INVALID_HANDLE_VALUE) { // A data file is missing from the installation directory. The original implementation // asks for a CD-ROM path at this point and stores it in cdrom_path @ 0x9AA318. @@ -282,6 +265,16 @@ int check_file_path(int pathId) return 0; } break; + + case PATH_ID_CUSTOM1: + if (file != INVALID_HANDLE_VALUE) + RCT2_GLOBAL(0x009AF164, unsigned int) = SetFilePointer(file, 0, 0, FILE_END); // Store file size in music_custom1_size @ 0x009AF164 + break; + + case PATH_ID_CUSTOM2: + if (file != INVALID_HANDLE_VALUE) + RCT2_GLOBAL(0x009AF16E, unsigned int) = SetFilePointer(file, 0, 0, FILE_END); // Store file size in music_custom2_size @ 0x009AF16E + break; } if (file != INVALID_HANDLE_VALUE) diff --git a/src/title.c b/src/title.c index d7a16d1b94..ee75bc2cf3 100644 --- a/src/title.c +++ b/src/title.c @@ -171,11 +171,12 @@ static void title_update_showcase() _scriptWaitCounter = (*_currentScript++) * 32; break; case TITLE_SCRIPT_LOAD: - if (!scenario_load(get_file_path(PATH_ID_SIXFLAGS_MAGICMOUNTAIN))) { - log_fatal("OpenRCT2 can not currently cope when unable to load title screen scenario."); - exit(-1); + if (scenario_load(get_file_path(PATH_ID_SIXFLAGS_MAGICMOUNTAIN))) { + log_verbose("loaded title scenario"); + } else { + RCT2_CALLPROC_EBPSAFE(0x006837E3); + title_create_windows(); } - log_verbose("loaded title scenario"); w = window_get_main(); w->viewport_target_sprite = -1;