From b72aac9fbfd1976b757a5fb8d8d4164556f60c93 Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Mon, 16 May 2016 10:50:56 +0200 Subject: [PATCH 1/2] Set NO_MONEY_SCENARIO flag when importing SC4 scenarios without money, fixes #3459 --- src/rct1/S4Importer.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/rct1/S4Importer.cpp b/src/rct1/S4Importer.cpp index 7ed2138f63..e04a2893b0 100644 --- a/src/rct1/S4Importer.cpp +++ b/src/rct1/S4Importer.cpp @@ -996,6 +996,12 @@ void S4Importer::ImportParkFlags() { gCheatsUnlockAllPrices = true; } + // RCT2 uses two flags for no money (for cheat detection). RCT1 used only one. + // Copy its value to make no money scenarios such as Arid Heights work properly. + if (_s4.park_flags & PARK_FLAGS_NO_MONEY) + { + gParkFlags |= PARK_FLAGS_NO_MONEY_SCENARIO; + } } void S4Importer::ImportClimate() From af65758bd24de47e285910f74427880395f469a2 Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Mon, 16 May 2016 20:38:55 +0200 Subject: [PATCH 2/2] Create RCT1_PARK_FLAGS and use them when importing --- src/rct1.h | 18 ++++++++++++++++++ src/rct1/S4Importer.cpp | 4 ++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/rct1.h b/src/rct1.h index eb17a534c3..fde853f762 100644 --- a/src/rct1.h +++ b/src/rct1.h @@ -713,6 +713,24 @@ enum { RCT1_SCENARIO_FLAG_19 = 1 << 19, }; +enum { + RCT1_PARK_FLAGS_PARK_OPEN = (1 << 0), + RCT1_PARK_FLAGS_SCENARIO_COMPLETE_NAME_INPUT = (1 << 1), + RCT1_PARK_FLAGS_FORBID_LANDSCAPE_CHANGES = (1 << 2), + RCT1_PARK_FLAGS_FORBID_TREE_REMOVAL = (1 << 3), + RCT1_PARK_FLAGS_SHOW_REAL_GUEST_NAMES = (1 << 4), + RCT1_PARK_FLAGS_FORBID_HIGH_CONSTRUCTION = (1 << 5), // Below tree height + RCT1_PARK_FLAGS_PREF_LESS_INTENSE_RIDES = (1 << 6), + RCT1_PARK_FLAGS_FORBID_MARKETING_CAMPAIGN = (1 << 7), + RCT1_PARK_FLAGS_ANTI_CHEAT_DEPRECATED = (1 << 8), // Not used anymore, used for cheat detection + RCT1_PARK_FLAGS_PREF_MORE_INTENSE_RIDES = (1 << 9), + RCT1_PARK_FLAGS_NO_MONEY = (1 << 11), // Used for both scenarios and saved games, unlike RCT2 + RCT1_PARK_FLAGS_DIFFICULT_GUEST_GENERATION = (1 << 12), + RCT1_PARK_FLAGS_PARK_ENTRY_LOCKED_AT_FREE = (1 << 13), // Off: rides and park entry chargeable. On: only rides chargeable. + RCT1_PARK_FLAGS_DIFFICULT_PARK_RATING = (1 << 14), + RCT1_PARK_FLAGS_LOCK_REAL_NAMES_OPTION = (1 << 15), +}; + extern const uint8 gRideCategories[0x60]; bool rct1_read_sc4(const char *path, rct1_s4 *s4); diff --git a/src/rct1/S4Importer.cpp b/src/rct1/S4Importer.cpp index e04a2893b0..8affc62f61 100644 --- a/src/rct1/S4Importer.cpp +++ b/src/rct1/S4Importer.cpp @@ -992,13 +992,13 @@ void S4Importer::ImportParkFlags() // Flags gParkFlags = _s4.park_flags; gParkFlags &= ~PARK_FLAGS_ANTI_CHEAT_DEPRECATED; - if (!(_s4.park_flags & PARK_FLAGS_PARK_FREE_ENTRY)) + if (!(_s4.park_flags & RCT1_PARK_FLAGS_PARK_ENTRY_LOCKED_AT_FREE)) { gCheatsUnlockAllPrices = true; } // RCT2 uses two flags for no money (for cheat detection). RCT1 used only one. // Copy its value to make no money scenarios such as Arid Heights work properly. - if (_s4.park_flags & PARK_FLAGS_NO_MONEY) + if (_s4.park_flags & RCT1_PARK_FLAGS_NO_MONEY) { gParkFlags |= PARK_FLAGS_NO_MONEY_SCENARIO; }