From 559a5c662ae42644a2f67d9cfde2b773b49cebc4 Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Sun, 31 Dec 2017 19:53:40 +0100 Subject: [PATCH] Fix import of RCT1 mazes --- distribution/changelog.txt | 3 ++- src/openrct2/rct1/S4Importer.cpp | 20 ++++++++++---------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index cb63afcb83..f2d1a1ac9f 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -85,11 +85,12 @@ - Fix: [#6657] Guest list is missing tracking icon after reopening. - Fix: [#6803] Symbolic links to directories are not descended by FileScanner. - Fix: [#6830] Crash when using mountain tool due to ride with no ride entry. -- Fix: [#6833] Shops and mazes in corrupted files not imported correctly. +- Fix: [#6833] Shops in corrupted files not imported correctly. - Fix: [#6846] Zoom level in some ride overview windows was erroneously set too high. - Fix: Infinite loop when removing scenery elements with >127 base height. - Fix: Ghosting of transparent map elements when the viewport is moved in OpenGL mode. - Fix: Clear IME buffer after committing composed text. +- Fix: RCT1 mazes with wooden fences not imported correctly. - Fix: Title sequence editor now gracefully fails to preview a title sequence and lets the user know with an error message. - Fix: When preset title sequence fails to load, the preset will forcibly be changed to the first sequence to successfully load. - Improved: [#6186] Transparent menu items now draw properly in OpenGL mode. diff --git a/src/openrct2/rct1/S4Importer.cpp b/src/openrct2/rct1/S4Importer.cpp index 0722d91bcc..3850af5bd0 100644 --- a/src/openrct2/rct1/S4Importer.cpp +++ b/src/openrct2/rct1/S4Importer.cpp @@ -939,16 +939,6 @@ private: void SetRideColourScheme(Ride * dst, rct1_ride * src) { - // In RCT1 and AA, the maze was always hedges. - // LL has 4 types, like RCT2. For LL, only guard against invalid values. - if (dst->type == RIDE_TYPE_MAZE) - { - if (_gameVersion < FILE_VERSION_RCT1_LL || src->track_colour_supports[0] > 3) - dst->track_colour_supports[0] = MAZE_WALL_TYPE_HEDGE; - - return; - } - // Colours dst->colour_scheme_type = src->colour_scheme; if (_gameVersion == FILE_VERSION_RCT1) @@ -1031,6 +1021,16 @@ private: } } } + + // In RCT1 and AA, the maze was always hedges. + // LL has 4 types, like RCT2. For LL, only guard against invalid values. + if (dst->type == RIDE_TYPE_MAZE) + { + if (_gameVersion < FILE_VERSION_RCT1_LL || src->track_colour_supports[0] > 3) + dst->track_colour_supports[0] = MAZE_WALL_TYPE_HEDGE; + else + dst->track_colour_supports[0] = src->track_colour_supports[0]; + } } void FixRideVehicleLinks(const uint16 * spriteIndexMap)