From 7feb0f8f7e400e4a58629ec85c3a27e4f323edd6 Mon Sep 17 00:00:00 2001 From: Michael Steenbeek Date: Tue, 28 Nov 2017 11:49:34 +0100 Subject: [PATCH] Fix #4760: Correct guest entry points on loading scenario --- src/openrct2/rct2/S6Importer.cpp | 33 ++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/src/openrct2/rct2/S6Importer.cpp b/src/openrct2/rct2/S6Importer.cpp index 8a059144df..561fb4ba3b 100644 --- a/src/openrct2/rct2/S6Importer.cpp +++ b/src/openrct2/rct2/S6Importer.cpp @@ -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)