1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-27 08:45:00 +01:00

Fix #5788: Empty scenario name becomes invisible list entry (#6197)

This commit is contained in:
Keatzee
2017-08-19 01:49:35 -04:00
committed by Michael Steenbeek
parent 96fbffa3f2
commit b89e01de8b
2 changed files with 13 additions and 4 deletions

View File

@@ -410,11 +410,19 @@ private:
entry.objective_arg_2 = s6Info->objective_arg_2;
entry.objective_arg_3 = s6Info->objective_arg_3;
entry.highscore = nullptr;
String::Set(entry.name, sizeof(entry.name), s6Info->name);
String::Set(entry.details, sizeof(entry.details), s6Info->details);
if (String::IsNullOrEmpty(s6Info->name))
{
// If the scenario doesn't have a name, set it to the filename
String::Set(entry.name, sizeof(entry.name), Path::GetFileNameWithoutExtension(entry.path));
}
else
{
String::Set(entry.name, sizeof(entry.name), s6Info->name);
// Normalise the name to make the scenario as recognisable as possible.
ScenarioSources::NormaliseName(entry.name, sizeof(entry.name), entry.name);
}
// Normalise the name to make the scenario as recognisable as possible.
ScenarioSources::NormaliseName(entry.name, sizeof(entry.name), entry.name);
String::Set(entry.details, sizeof(entry.details), s6Info->details);
// Look up and store information regarding the origins of this scenario.
source_desc desc;