From a4ed1cb6ced5e036e0a29f5d562a3326f31cd796 Mon Sep 17 00:00:00 2001 From: Hielke Morsink Date: Fri, 22 Oct 2021 14:59:42 +0200 Subject: [PATCH 01/10] Update feature requests link to point to Discussions --- .github/ISSUE_TEMPLATE/config.yml | 3 +++ .github/ISSUE_TEMPLATE/feature_request.yaml | 29 --------------------- 2 files changed, 3 insertions(+), 29 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE/feature_request.yaml diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index fb2d52387e..44ccf896eb 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1,5 +1,8 @@ blank_issues_enabled: true contact_links: +- name: Feature request + url: https://github.com/OpenRCT2/OpenRCT2/discussions/categories/feature-requests + about: Request a new feature to be added to OpenRCT2. - name: Translation / Localisation url: https://github.com/OpenRCT2/Localisation about: For localisation issues, go to the localisation repository. diff --git a/.github/ISSUE_TEMPLATE/feature_request.yaml b/.github/ISSUE_TEMPLATE/feature_request.yaml deleted file mode 100644 index 6986b22216..0000000000 --- a/.github/ISSUE_TEMPLATE/feature_request.yaml +++ /dev/null @@ -1,29 +0,0 @@ -name: Feature request -description: Request a new feature to be added to OpenRCT2. -labels: -- feature - -body: -- type: markdown - attributes: - value: Before filing this request, [please check if it hasn't already been suggested before](https://github.com/OpenRCT2/OpenRCT2/issues?q=is%3Aissue+label%3Afeature). If it has, please add to the existing issue instead. - -- type: textarea - attributes: - label: Describe the feature - placeholder: Describe your feature idea here. You can paste or drag & drop attachments here to help on illustrating it. - validations: - required: true - -- type: dropdown - attributes: - label: Feature type - description: What would this feature improve? Check all that apply. - multiple: true - options: - - Quality of life - - Multiplayer - - Plug-ins - - Other - validations: - required: true From 815d09a431172247b01bd9c45659445af365a799 Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Wed, 20 Oct 2021 23:13:01 +0200 Subject: [PATCH 02/10] Fix #14482: Rides with Crooked House hack sometimes misbehave --- distribution/changelog.txt | 1 + src/openrct2/rct2/RCT2.cpp | 4 ++-- src/openrct2/rct2/RCT2.h | 2 +- src/openrct2/rct2/S6Importer.cpp | 30 ++++++++++++++++++++++++++++-- 4 files changed, 32 insertions(+), 5 deletions(-) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 0bd317dde3..5914e5a294 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -13,6 +13,7 @@ - Fix: [#13465] Creating a scenario based on a won save game results in a scenario that’s instantly won. - Fix: [#13912] “Dome park” no longer renders dome correctly. - Fix: [#14316] Closing the Track Designs Manager window causes broken state. +- Fix: [#14482, #15258] Rides with invisibility hacks sometimes behave incorrectly. - Fix: [#14649] ImageImporter incorrectly remaps colours outside the RCT2 palette. - Fix: [#14667] “Extreme Hawaiian Island” has unpurchaseable land tiles (original bug). - Fix: [#14741] Crash when exiting OpenRCT2 on macOS. diff --git a/src/openrct2/rct2/RCT2.cpp b/src/openrct2/rct2/RCT2.cpp index b20d609a04..80048c8a10 100644 --- a/src/openrct2/rct2/RCT2.cpp +++ b/src/openrct2/rct2/RCT2.cpp @@ -140,9 +140,9 @@ bool RCT2TrackTypeIsBooster(uint8_t rideType, uint16_t trackType) && trackType == TrackElemType::Booster; } -track_type_t RCT2TrackTypeToOpenRCT2(RCT12TrackType origTrackType, uint8_t rideType) +track_type_t RCT2TrackTypeToOpenRCT2(RCT12TrackType origTrackType, uint8_t rideType, bool convertFlat) { - if (GetRideTypeDescriptor(rideType).HasFlag(RIDE_TYPE_FLAG_FLAT_RIDE)) + if (convertFlat && GetRideTypeDescriptor(rideType).HasFlag(RIDE_TYPE_FLAG_FLAT_RIDE)) return RCT12FlatTrackTypeToOpenRCT2(origTrackType); if (origTrackType == TrackElemType::RotationControlToggleAlias && !RCT2TrackTypeIsBooster(rideType, origTrackType)) return TrackElemType::RotationControlToggle; diff --git a/src/openrct2/rct2/RCT2.h b/src/openrct2/rct2/RCT2.h index d571ec96d6..217d93232e 100644 --- a/src/openrct2/rct2/RCT2.h +++ b/src/openrct2/rct2/RCT2.h @@ -1069,7 +1069,7 @@ ObjectEntryIndex RCT2RideTypeToOpenRCT2RideType(uint8_t rct2RideType, const rct_ bool RCT2TrackTypeIsBooster(uint8_t rideType, uint16_t trackType); bool RCT2RideTypeNeedsConversion(uint8_t rct2RideType); uint8_t OpenRCT2RideTypeToRCT2RideType(ObjectEntryIndex openrct2Type); -track_type_t RCT2TrackTypeToOpenRCT2(RCT12TrackType origTrackType, uint8_t rideType); +track_type_t RCT2TrackTypeToOpenRCT2(RCT12TrackType origTrackType, uint8_t rideType, bool convertFlat = true); RCT12TrackType OpenRCT2TrackTypeToRCT2(track_type_t origTrackType); /** diff --git a/src/openrct2/rct2/S6Importer.cpp b/src/openrct2/rct2/S6Importer.cpp index 9795f4a7ae..72b6f2cd6e 100644 --- a/src/openrct2/rct2/S6Importer.cpp +++ b/src/openrct2/rct2/S6Importer.cpp @@ -86,6 +86,7 @@ private: rct_s6_data _s6{}; uint8_t _gameVersion = 0; bool _isSV7 = false; + std::bitset _isFlatRide{}; public: S6Importer(IObjectRepository& objectRepository) @@ -234,6 +235,7 @@ public: scenario_rand_seed(_s6.scenario_srand_0, _s6.scenario_srand_1); + DetermineFlatRideStatus(); ImportTileElements(); ImportEntities(); @@ -544,6 +546,29 @@ public: } } + void DetermineFlatRideStatus() + { + for (uint8_t index = 0; index < RCT12_MAX_RIDES_IN_PARK; index++) + { + auto src = &_s6.rides[index]; + if (src->type == RIDE_TYPE_NULL) + continue; + + auto subtype = RCTEntryIndexToOpenRCT2EntryIndex(src->subtype); + auto* rideEntry = get_ride_entry(subtype); + + // This code is needed to detect hacks where a tracked ride has been made invisible + // by setting its ride type to a flat ride. + ObjectEntryIndex originalRideType = src->type; + if (rideEntry != nullptr) + { + originalRideType = ride_entry_get_first_non_null_ride_type(rideEntry); + } + const auto isFlatRide = GetRideTypeDescriptor(originalRideType).HasFlag(RIDE_TYPE_FLAG_FLAT_RIDE); + _isFlatRide.set(static_cast(index), isFlatRide); + } + } + void ImportRide(Ride* dst, const rct2_ride* src, const ride_id_t rideIndex) { *dst = {}; @@ -860,7 +885,8 @@ public: dst.CurrentRide = RCT12RideIdToOpenRCT2RideId(src.current_ride); dst.State = src.state; if (src.current_ride < RCT12_MAX_RIDES_IN_PARK && _s6.rides[src.current_ride].type < std::size(RideTypeDescriptors)) - dst.ProximityTrackType = RCT2TrackTypeToOpenRCT2(src.proximity_track_type, _s6.rides[src.current_ride].type); + dst.ProximityTrackType = RCT2TrackTypeToOpenRCT2( + src.proximity_track_type, _s6.rides[src.current_ride].type, _isFlatRide[src.current_ride]); else dst.ProximityTrackType = 0xFF; dst.ProximityBaseHeight = src.proximity_base_height; @@ -1203,7 +1229,7 @@ public: auto rideType = _s6.rides[src2->GetRideIndex()].type; track_type_t trackType = static_cast(src2->GetTrackType()); - dst2->SetTrackType(RCT2TrackTypeToOpenRCT2(trackType, rideType)); + dst2->SetTrackType(RCT2TrackTypeToOpenRCT2(trackType, rideType, _isFlatRide[src2->GetRideIndex()])); dst2->SetRideType(rideType); dst2->SetSequenceIndex(src2->GetSequenceIndex()); dst2->SetRideIndex(RCT12RideIdToOpenRCT2RideId(src2->GetRideIndex())); From afb49dfe38b5895e05e042ea074e17da7a1f6d7c Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Wed, 20 Oct 2021 23:42:47 +0200 Subject: [PATCH 03/10] Also fix vehicle track refs for good measure --- src/openrct2/rct2/S6Importer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openrct2/rct2/S6Importer.cpp b/src/openrct2/rct2/S6Importer.cpp index 72b6f2cd6e..347cfa9c3a 100644 --- a/src/openrct2/rct2/S6Importer.cpp +++ b/src/openrct2/rct2/S6Importer.cpp @@ -1674,7 +1674,7 @@ template<> void S6Importer::ImportEntity(const RCT12SpriteBase& baseSrc dst->SetTrackType(src->GetTrackType()); // RotationControlToggle and Booster are saved as the same track piece ID // Which one the vehicle is using must be determined - if (GetRideTypeDescriptor(ride.type).HasFlag(RIDE_TYPE_FLAG_FLAT_RIDE)) + if (_isFlatRide[src->ride]) { dst->SetTrackType(RCT12FlatTrackTypeToOpenRCT2(src->GetTrackType())); } From 59e73f9cfb6ead080a81ef840b3728a098cd4560 Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Thu, 21 Oct 2021 22:41:17 +0200 Subject: [PATCH 04/10] Add additional explanation + fix for flat ride vehicles on track --- src/openrct2/rct2/S6Importer.cpp | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/src/openrct2/rct2/S6Importer.cpp b/src/openrct2/rct2/S6Importer.cpp index 347cfa9c3a..00ad2550af 100644 --- a/src/openrct2/rct2/S6Importer.cpp +++ b/src/openrct2/rct2/S6Importer.cpp @@ -546,6 +546,17 @@ public: } } + /** + * This code is needed to detect hacks where a tracked ride has been made invisible + * by setting its ride type to a flat ride. + * + * The function should classify rides as follows: + * 1. If the ride type is tracked and its vehicles also belong on tracks, it should be classified as tracked. + * 2. If the ride type is a flat ride, but its vehicles belong on tracks, + * it should be classified as tracked (Crooked House mod). + * 3. If the ride type is tracked and its vehicles belong to a flat ride, it should be classified as tracked. + * 4. If the ride type is a flat ride and its vehicles also belong to a flat ride, it should be classified as a flat ride. + */ void DetermineFlatRideStatus() { for (uint8_t index = 0; index < RCT12_MAX_RIDES_IN_PARK; index++) @@ -556,9 +567,15 @@ public: auto subtype = RCTEntryIndexToOpenRCT2EntryIndex(src->subtype); auto* rideEntry = get_ride_entry(subtype); + // If the ride is tracked, we don’t need to check the vehicle any more. + if (!GetRideTypeDescriptor(src->type).HasFlag(RIDE_TYPE_FLAG_FLAT_RIDE)) + { + _isFlatRide[index] = false; + continue; + } - // This code is needed to detect hacks where a tracked ride has been made invisible - // by setting its ride type to a flat ride. + // We have established the ride type is a flat ride, which means the vehicle now determines whether it is a + // true flat ride (scenario 4) or a tracked ride with an invisibility hack (scenario 2). ObjectEntryIndex originalRideType = src->type; if (rideEntry != nullptr) { From 9b6b86c85561f2f426fcd8defedb740fb93a60e2 Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Fri, 22 Oct 2021 16:16:50 +0200 Subject: [PATCH 05/10] Make convertFlat parameter explicit --- src/openrct2/rct2/RCT2.h | 2 +- src/openrct2/rct2/T6Importer.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/openrct2/rct2/RCT2.h b/src/openrct2/rct2/RCT2.h index 217d93232e..8b8f5d652a 100644 --- a/src/openrct2/rct2/RCT2.h +++ b/src/openrct2/rct2/RCT2.h @@ -1069,7 +1069,7 @@ ObjectEntryIndex RCT2RideTypeToOpenRCT2RideType(uint8_t rct2RideType, const rct_ bool RCT2TrackTypeIsBooster(uint8_t rideType, uint16_t trackType); bool RCT2RideTypeNeedsConversion(uint8_t rct2RideType); uint8_t OpenRCT2RideTypeToRCT2RideType(ObjectEntryIndex openrct2Type); -track_type_t RCT2TrackTypeToOpenRCT2(RCT12TrackType origTrackType, uint8_t rideType, bool convertFlat = true); +track_type_t RCT2TrackTypeToOpenRCT2(RCT12TrackType origTrackType, uint8_t rideType, bool convertFlat); RCT12TrackType OpenRCT2TrackTypeToRCT2(track_type_t origTrackType); /** diff --git a/src/openrct2/rct2/T6Importer.cpp b/src/openrct2/rct2/T6Importer.cpp index a32037b4c9..75b912957f 100644 --- a/src/openrct2/rct2/T6Importer.cpp +++ b/src/openrct2/rct2/T6Importer.cpp @@ -168,7 +168,7 @@ public: _stream.Read(&t6TrackElement, sizeof(rct_td46_track_element)); TrackDesignTrackElement trackElement{}; - track_type_t trackType = RCT2TrackTypeToOpenRCT2(t6TrackElement.type, td->type); + track_type_t trackType = RCT2TrackTypeToOpenRCT2(t6TrackElement.type, td->type, true); if (trackType == TrackElemType::InvertedUp90ToFlatQuarterLoopAlias) { trackType = TrackElemType::MultiDimInvertedUp90ToFlatQuarterLoop; From 9e0fac9169e2cd73caeccfd27f9790d15871b14a Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Fri, 22 Oct 2021 16:17:40 +0200 Subject: [PATCH 06/10] Bump network version --- src/openrct2/network/NetworkBase.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openrct2/network/NetworkBase.cpp b/src/openrct2/network/NetworkBase.cpp index f0970fba8d..29bb5d6b93 100644 --- a/src/openrct2/network/NetworkBase.cpp +++ b/src/openrct2/network/NetworkBase.cpp @@ -38,7 +38,7 @@ // This string specifies which version of network stream current build uses. // It is used for making sure only compatible builds get connected, even within // single OpenRCT2 version. -#define NETWORK_STREAM_VERSION "14" +#define NETWORK_STREAM_VERSION "15" #define NETWORK_STREAM_ID OPENRCT2_VERSION "-" NETWORK_STREAM_VERSION static Peep* _pickup_peep = nullptr; From 72439c28d2300527bef6c945415b9fb3eb2a3065 Mon Sep 17 00:00:00 2001 From: OpenRCT2 git bot Date: Sat, 23 Oct 2021 04:08:27 +0000 Subject: [PATCH 07/10] Merge Localisation/master into OpenRCT2/develop --- data/language/es-ES.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/data/language/es-ES.txt b/data/language/es-ES.txt index c6866627d6..ff9ecf6a4e 100644 --- a/data/language/es-ES.txt +++ b/data/language/es-ES.txt @@ -3612,6 +3612,8 @@ STR_6408 :Please install “innoextract” to extract GOG Installer, then res STR_6409 :El archivo seleccionado no es el Instalador sin conexión de GOG para RollerCoaster Tycoon 2. Puede que hayas descargado GOG Galaxy downloader stub o ha seleccionado el archivo incorrecto. STR_6454 :No se puede cambiar el nombre del banner… STR_6455 :No se puede cambiar el nombre del señal… +STR_6457 :Informar un error en GitHub +STR_6458 :Siga esto en la Vista Principal ############## # Escenarios # From 2146abb17f84265ea1f89bb0a3c1e503b0d1c6f4 Mon Sep 17 00:00:00 2001 From: OpenRCT2 git bot Date: Tue, 26 Oct 2021 04:08:51 +0000 Subject: [PATCH 08/10] Merge Localisation/master into OpenRCT2/develop --- data/language/es-ES.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/data/language/es-ES.txt b/data/language/es-ES.txt index ff9ecf6a4e..0e5b5681f2 100644 --- a/data/language/es-ES.txt +++ b/data/language/es-ES.txt @@ -3612,6 +3612,7 @@ STR_6408 :Please install “innoextract” to extract GOG Installer, then res STR_6409 :El archivo seleccionado no es el Instalador sin conexión de GOG para RollerCoaster Tycoon 2. Puede que hayas descargado GOG Galaxy downloader stub o ha seleccionado el archivo incorrecto. STR_6454 :No se puede cambiar el nombre del banner… STR_6455 :No se puede cambiar el nombre del señal… +STR_6456 :Captura de pantalla gigante STR_6457 :Informar un error en GitHub STR_6458 :Siga esto en la Vista Principal From dd007c836fab72dbaa6b4b6e136f9b60083e7114 Mon Sep 17 00:00:00 2001 From: Michael Steenbeek Date: Tue, 26 Oct 2021 20:05:13 +0200 Subject: [PATCH 09/10] Fix #15579: Crash in track_block_get_next() --- distribution/changelog.txt | 1 + src/openrct2/ride/Ride.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 5914e5a294..6e21f7e1be 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -43,6 +43,7 @@ - Fix: [#15514] Two different “quit to menu” menu items are available in track designer and track design manager. - Fix: [#15560] Memory leak due to OpenGL Renderer not releasing a texture. - Fix: [#15567] Litter not being counted correctly during Park rating calculation (original bug). +- Fix: [#15579] Crash in track_block_get_next(). - Fix: [#15582] [Plugin] Litter properties return incorrect values. - Fix: [#15584] Ride income underflows when on-ride photos are making losses. - Fix: [#15612] Crash when placing walls beside certain scenery objects. diff --git a/src/openrct2/ride/Ride.cpp b/src/openrct2/ride/Ride.cpp index 9e62de1cd6..3e36f15532 100644 --- a/src/openrct2/ride/Ride.cpp +++ b/src/openrct2/ride/Ride.cpp @@ -525,7 +525,6 @@ bool track_block_get_next(CoordsXYE* input, CoordsXYE* output, int32_t* z, int32 return false; auto inputElement = input->element->AsTrack(); - const auto& ted = GetTrackElementDescriptor(inputElement->GetTrackType()); if (inputElement == nullptr) return false; @@ -534,6 +533,7 @@ bool track_block_get_next(CoordsXYE* input, CoordsXYE* output, int32_t* z, int32 if (ride == nullptr) return false; + const auto& ted = GetTrackElementDescriptor(inputElement->GetTrackType()); const auto* trackBlock = ted.Block; if (trackBlock == nullptr) return false; From a1b70b59d6425039b21e3aef2569ec9b3d9854f2 Mon Sep 17 00:00:00 2001 From: Michael Steenbeek Date: Tue, 26 Oct 2021 20:10:03 +0200 Subject: [PATCH 10/10] Fix #15177: Crash in lightfx_add_lights_magic_vehicle() --- distribution/changelog.txt | 1 + src/openrct2/drawing/LightFX.cpp | 2 ++ 2 files changed, 3 insertions(+) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 6e21f7e1be..b596fa8697 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -22,6 +22,7 @@ - Fix: [#15142] ToonTowner's mine roofs were moved into the pirate theme scenery group instead of the mine theme scenery group. - Fix: [#15148] Track Designs Manager delete confirmation window doesn't display properly. - Fix: [#15170] Plugin: incorrect label text alignment. +- Fix: [#15177] Crash in lightfx_add_lights_magic_vehicle(). - Fix: [#15184] Crash when hovering over water types in Object Selection. - Fix: [#15193] Crash when rides/stalls are demolished. - Fix: [#15197] Cannot place flat ride after removing it in construction window. diff --git a/src/openrct2/drawing/LightFX.cpp b/src/openrct2/drawing/LightFX.cpp index 0b8f31751b..86e32f1806 100644 --- a/src/openrct2/drawing/LightFX.cpp +++ b/src/openrct2/drawing/LightFX.cpp @@ -710,6 +710,8 @@ void lightfx_add_lights_magic_vehicle(const Vehicle* vehicle) }; auto ride = vehicle->GetRide(); + if (ride == nullptr) + return; switch (ride->type) {