1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2025-12-10 09:32:29 +01:00

Add option to allow loading scenarios with an incorrect checksum

This commit is contained in:
Gymnasiast
2015-08-18 10:04:10 +02:00
parent abe02bb408
commit 4fa571a041
5 changed files with 9 additions and 2 deletions

View File

@@ -3845,4 +3845,6 @@ STR_5503 :Enter hostname or IP address:
STR_5504 :{SMALLFONT}{BLACK}Show multiplayer status
STR_5505 :Unable to connect to server.
STR_5506 :Guests ignore intensities
STR_5507 :Handymen mow grass by default
STR_5507 :Handymen mow grass by default
STR_5508 :Allow loading files with incorrect checksums
STR_5509 :{SMALLFONT}{BLACK}Allows loading scenarios and saves that have an incorrect checksum, like the scenarios from the demo or damaged saves.

View File

@@ -191,6 +191,7 @@ config_property_definition _generalDefinitions[] = {
{ offsetof(general_configuration, minimize_fullscreen_focus_loss), "minimize_fullscreen_focus_loss",CONFIG_VALUE_TYPE_BOOLEAN, true, NULL },
{ offsetof(general_configuration, day_night_cycle), "day_night_cycle", CONFIG_VALUE_TYPE_BOOLEAN, false, NULL },
{ offsetof(general_configuration, upper_case_banners), "upper_case_banners", CONFIG_VALUE_TYPE_BOOLEAN, false, NULL },
{ offsetof(general_configuration, allow_loading_with_incorrect_checksum),"allow_loading_with_incorrect_checksum", CONFIG_VALUE_TYPE_BOOLEAN, false, NULL },
};
config_property_definition _interfaceDefinitions[] = {

View File

@@ -164,6 +164,7 @@ typedef struct {
uint8 minimize_fullscreen_focus_loss;
uint8 day_night_cycle;
uint8 upper_case_banners;
uint8 allow_loading_with_incorrect_checksum;
} general_configuration;
typedef struct {

View File

@@ -2047,6 +2047,9 @@ enum {
STR_SHOW_MULTIPLAYER_STATUS_TIP = 5504,
STR_UNABLE_TO_CONNECT_TO_SERVER = 5505,
STR_ALLOW_LOADING_WITH_INCORRECT_CHECKSUM = 5508,
STR_ALLOW_LOADING_WITH_INCORRECT_CHECKSUM_TIP = 5509,
// Have to include resource strings (from scenarios and objects) for the time being now that language is partially working
STR_COUNT = 32768
};

View File

@@ -109,7 +109,7 @@ int scenario_load(const char *path)
rw = platform_sdl_rwfromfile(path, "rb");
if (rw != NULL) {
if (!sawyercoding_validate_checksum(rw)) {
if (!sawyercoding_validate_checksum(rw) && !gConfigGeneral.allow_loading_with_incorrect_checksum) {
SDL_RWclose(rw);
RCT2_GLOBAL(RCT2_ADDRESS_ERROR_TYPE, uint8) = 255;
RCT2_GLOBAL(RCT2_ADDRESS_ERROR_STRING_ID, uint16) = STR_FILE_CONTAINS_INVALID_DATA;