1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-26 16:24:35 +01:00

Fix #4760: Correct guest entry points on loading scenario

This commit is contained in:
Michael Steenbeek
2017-11-28 11:49:34 +01:00
parent 32f91e3e45
commit 7feb0f8f7e

View File

@@ -455,6 +455,8 @@ public:
{
log_error("Found %d disjoint null sprites", disjoint_sprites_count);
}
FixEntryPoints();
}
void ImportRides()
@@ -701,6 +703,37 @@ public:
{
game_init_all(_s6.map_size);
}
/**
* Clears incorrectly set guest entry points.
*/
void FixEntryPoints()
{
// Many WW and TT have scenario_filename fields containing an incorrect filename. Check for both this filename
// and the corrected filename.
// In this park, gPeepSpawns[0] is incorrect, and gPeepSpawns[1] is correct.
if (String::Equals(_s6.scenario_filename, "WW South America - Rio Carnival.SC6") ||
String::Equals(_s6.scenario_filename, "South America - Rio Carnival.SC6"))
{
gPeepSpawns[0] = { 2160, 3167, 6, 1 };
for (size_t i = 1; i < MAX_PEEP_SPAWNS; i++)
{
gPeepSpawns[i].x = PEEP_SPAWN_UNDEFINED;
}
}
// In this park, gPeepSpawns[0] is correct. Just clear the rest.
else if (String::Equals(_s6.scenario_filename, "Great Wall of China Tourism Enhancement.SC6") ||
String::Equals(_s6.scenario_filename, "Asia - Great Wall of China Tourism Enhancement.SC6"))
{
for (size_t i = 1; i < MAX_PEEP_SPAWNS; i++)
{
gPeepSpawns[i].x = PEEP_SPAWN_UNDEFINED;
}
}
}
};
IParkImporter * ParkImporter::CreateS6(IObjectRepository * objectRepository, IObjectManager * objectManager)