From 86c7dbf1d531e92aaaa7ea57dde1fdb7a8d5bfad Mon Sep 17 00:00:00 2001 From: Michael Steenbeek Date: Sat, 22 Feb 2020 19:06:57 +0100 Subject: [PATCH] Fix #7854: Cannot build custom Spiral RC; dummy entries in track designs list (#10814) --- distribution/changelog.txt | 2 ++ src/openrct2-ui/windows/TrackList.cpp | 16 ++++++++-------- src/openrct2/ride/TrackDesignRepository.cpp | 2 +- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 4e0458c892..7ac608f3c2 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -10,6 +10,8 @@ - Change: [#1164] Use available translations for shortcut key bindings. - Fix: [#5249] No collision detection when building ride entrance at heights > 85.5m. - Fix: [#7784] Vehicle tab takes 1st car colour instead of tab_vehicle's colour. +- Fix: [#7854] Cannot build a custom spiral roller coaster design. +- Fix: [#7854] Empty entries in spiral roller coaster designs list. - Fix: [#8875] RCT1 competition scenarios are classified incorrectly. - Fix: [#10176] Mistake in the sprite for the land tool's 6x6 grid. - Fix: [#10196] Doors unable to be placed at end of track corners. diff --git a/src/openrct2-ui/windows/TrackList.cpp b/src/openrct2-ui/windows/TrackList.cpp index 59311917a6..7419b4e4d3 100644 --- a/src/openrct2-ui/windows/TrackList.cpp +++ b/src/openrct2-ui/windows/TrackList.cpp @@ -239,13 +239,6 @@ static void window_track_list_close(rct_window* w) */ static void window_track_list_select(rct_window* w, int32_t listIndex) { - // Displays a message if the ride can't load, fix #4080 - if (_loadedTrackDesign == nullptr) - { - context_show_error(STR_CANT_BUILD_PARK_ENTRANCE_HERE, STR_TRACK_LOAD_FAILED_ERROR); - return; - } - audio_play_sound(SoundId::Click1, 0, w->x + (w->width / 2)); if (!(gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER)) { @@ -258,7 +251,14 @@ static void window_track_list_select(rct_window* w, int32_t listIndex) listIndex--; } - if (_loadedTrackDesign && (_loadedTrackDesign->track_flags & TRACK_DESIGN_FLAG_SCENERY_UNAVAILABLE)) + // Displays a message if the ride can't load, fix #4080 + if (_loadedTrackDesign == nullptr) + { + context_show_error(STR_CANT_BUILD_PARK_ENTRANCE_HERE, STR_TRACK_LOAD_FAILED_ERROR); + return; + } + + if (_loadedTrackDesign->track_flags & TRACK_DESIGN_FLAG_SCENERY_UNAVAILABLE) { gTrackDesignSceneryToggle = true; } diff --git a/src/openrct2/ride/TrackDesignRepository.cpp b/src/openrct2/ride/TrackDesignRepository.cpp index 213225d558..02f04442ed 100644 --- a/src/openrct2/ride/TrackDesignRepository.cpp +++ b/src/openrct2/ride/TrackDesignRepository.cpp @@ -35,7 +35,7 @@ struct TrackRepositoryItem { std::string Name; std::string Path; - uint8_t RideType = 0; + uint8_t RideType = RIDE_TYPE_NULL; std::string ObjectEntry; uint32_t Flags = 0; };