diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 236dcfdfe2..9480598377 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -7,6 +7,7 @@ - Fix: [#5579] Network desync immediately after connecting. - Fix: [#6006] Objects higher than 6 metres are considered trees (original bug). - Fix: [#7884] Unfinished preserved rides can be demolished with quick demolish. +- Fix: [#8537] Imported RCT1 rides/shops are all numbered 1. - Fix: [#8873] Potential crash when placing footpaths. - Fix: [#8882] Submarine Ride does not count as indoors (original bug). - Fix: [#8900] Peep tracking is not synchronized. diff --git a/src/openrct2/rct1/S4Importer.cpp b/src/openrct2/rct1/S4Importer.cpp index 920eeaea8f..0e61e26db1 100644 --- a/src/openrct2/rct1/S4Importer.cpp +++ b/src/openrct2/rct1/S4Importer.cpp @@ -198,6 +198,7 @@ public: ImportSavedView(); FixLandOwnership(); CountBlockSections(); + SetDefaultNames(); determine_ride_entrance_and_exit_locations(); // Importing the strings is done later on, although that approach needs looking at. @@ -789,10 +790,6 @@ private: } } } - if (dst->name == 0) - { - ride_set_name_to_default(dst, rideEntry); - } dst->status = src->status; @@ -2979,6 +2976,24 @@ private: } } } + + /** + * This has to be done after importing tile elements, because it needs those to detect if a pre-existing ride + * name should be considered reserved. + */ + void SetDefaultNames() + { + ride_id_t i; + Ride* ride; + FOR_ALL_RIDES (i, ride) + { + if (ride->name == 0) + { + auto rideEntry = get_ride_entry(ride->subtype); + ride_set_name_to_default(ride, rideEntry); + } + } + } }; std::unique_ptr ParkImporter::CreateS4()