1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2025-12-23 15:52:55 +01:00

Close #12626: Allow completing RCTC scenarios with RCT2 saves

This commit is contained in:
Struan Clark
2021-07-19 10:12:03 -04:00
committed by GitHub
parent a39ee0cadc
commit aa69593064
3 changed files with 24 additions and 3 deletions

View File

@@ -171,6 +171,7 @@ The following people are not part of the development team, but have been contrib
* (zrowny)
* Emre Aydin (aemreaydin)
* Daniel Karandikar (DKarandikar)
* Struan Clark (xtruan)
## Toolchain
* (Balletie) - macOS

View File

@@ -1,5 +1,6 @@
0.3.4+ (in development)
------------------------------------------------------------------------
- Improved: [#12626] Allow using RCT2 saves to mark RCT Classic (.sea) parks as finished and vice versa.
0.3.4 (2021-07-19)
------------------------------------------------------------------------

View File

@@ -423,6 +423,25 @@ public:
Scan(language);
scenario_index_entry* scenario = GetByFilename(scenarioFileName);
// Check if this is an RCTC scenario that corresponds to a known RCT1/2 scenario or vice versa, see #12626
if (scenario == nullptr)
{
const std::string scenarioBaseName = String::ToStd(Path::GetFileNameWithoutExtension(scenarioFileName));
const std::string scenarioExtension = String::ToStd(Path::GetExtension(scenarioFileName));
if (String::Equals(scenarioExtension, ".sea", true))
{
// Get scenario using RCT2 style name of RCTC scenario
scenario = GetByFilename((scenarioBaseName + ".sc6").c_str());
}
else if (String::Equals(scenarioExtension, ".sc6", true))
{
// Get scenario using RCTC style name of RCT2 scenario
scenario = GetByFilename((scenarioBaseName + ".sea").c_str());
}
}
if (scenario != nullptr)
{
// Check if record company value has been broken or the highscore is the same but no name is registered
@@ -705,10 +724,10 @@ private:
{
for (auto& highscore : _highscores)
{
scenario_index_entry* scenerio = GetByFilename(highscore->fileName);
if (scenerio != nullptr)
scenario_index_entry* scenario = GetByFilename(highscore->fileName);
if (scenario != nullptr)
{
scenerio->highscore = highscore;
scenario->highscore = highscore;
}
}
}