1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-23 14:54:30 +01:00

Fix #8537: Imported RCT1 rides/shops are all numbered 1

This commit is contained in:
Michael Steenbeek
2019-03-27 20:07:13 +01:00
committed by GitHub
parent 2ca83c203a
commit bbf523e829
2 changed files with 20 additions and 4 deletions

View File

@@ -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<IParkImporter> ParkImporter::CreateS4()