Fix #6314: SV4s do not mark corresponding scenario as completed

This commit is contained in:
Richard Jenkins 2018-01-14 19:25:35 +00:00 committed by Michael Steenbeek
parent 8304f01aef
commit 1fc32182af
1 changed files with 10 additions and 1 deletions

View File

@ -126,6 +126,9 @@ private:
uint8 _researchRideEntryUsed[MAX_RIDE_OBJECTS];
uint8 _researchRideTypeUsed[RCT1_RIDE_TYPE_COUNT];
// Scenario repository - used for determining scenario name
IScenarioRepository * _scenarioRepository = GetScenarioRepository();
public:
ParkLoadResult Load(const utf8 * path) override
{
@ -325,7 +328,7 @@ private:
InitialiseEntryMaps();
uint16 mapSize = _s4.map_size == 0 ? 128 : _s4.map_size;
String::Set(gScenarioFileName, sizeof(gScenarioFileName), Path::GetFileName(_s4Path));
String::Set(gScenarioFileName, sizeof(gScenarioFileName), GetRCT1ScenarioName().c_str());
// Do map initialisation, same kind of stuff done when loading scenario editor
GetObjectManager()->UnloadAll();
@ -335,6 +338,12 @@ private:
gS6Info.category = SCENARIO_CATEGORY_OTHER;
}
std::string GetRCT1ScenarioName()
{
const scenario_index_entry * scenarioEntry = _scenarioRepository->GetByIndex(_s4.scenario_slot_index);
return path_get_filename(scenarioEntry->path);
}
void InitialiseEntryMaps()
{
Memory::Set(_rideTypeToRideEntryMap, 255, sizeof(_rideTypeToRideEntryMap));