From 695f7c33bf07b45b3e1034739516986274f77e8d Mon Sep 17 00:00:00 2001 From: Michael Steenbeek Date: Thu, 2 Feb 2017 22:21:05 +0100 Subject: [PATCH] Fix all known incorrect land ownership in RCT1 --- src/openrct2/rct1/S4Importer.cpp | 49 ++++++++++++++++------- src/openrct2/scenario/ScenarioSources.cpp | 2 +- src/openrct2/scenario/ScenarioSources.h | 2 +- 3 files changed, 37 insertions(+), 16 deletions(-) diff --git a/src/openrct2/rct1/S4Importer.cpp b/src/openrct2/rct1/S4Importer.cpp index 89dbed9611..2e8c936fc4 100644 --- a/src/openrct2/rct1/S4Importer.cpp +++ b/src/openrct2/rct1/S4Importer.cpp @@ -2356,21 +2356,42 @@ private: void FixLandOwnership() { - rct_map_element * currentElement; - - switch(_s4.scenario_slot_index) { - case SC_KATIES_DREAMLAND: - currentElement = map_get_surface_element_at(74, 70); - currentElement->properties.surface.ownership |= OWNERSHIP_AVAILABLE; - currentElement = map_get_surface_element_at(75, 70); - currentElement->properties.surface.ownership |= OWNERSHIP_AVAILABLE; - currentElement = map_get_surface_element_at(76, 70); - currentElement->properties.surface.ownership |= OWNERSHIP_AVAILABLE; - currentElement = map_get_surface_element_at(77, 73); - currentElement->properties.surface.ownership |= OWNERSHIP_AVAILABLE; - currentElement = map_get_surface_element_at(80, 77); - currentElement->properties.surface.ownership |= OWNERSHIP_AVAILABLE; + switch (_s4.scenario_slot_index) { + case SC_DYNAMITE_DUNES: + FixLandOwnershipTiles({ {97, 18}, {99, 19}, {83, 34} }); break; + case SC_LEAFY_LAKE: + FixLandOwnershipTiles({ {49, 66} }); + break; + case SC_KATIES_DREAMLAND: + FixLandOwnershipTiles({ {74, 70}, {75, 70}, {76, 70}, {77, 73}, {80, 77} }); + break; + case SC_POKEY_PARK: + FixLandOwnershipTiles({ {64, 102} }); + break; + case SC_MYSTIC_MOUNTAIN: + FixLandOwnershipTiles({ {98, 69}, {98, 70}, {103, 64}, {53, 79}, {86, 93}, {87, 93} }); + break; + case SC_PACIFIC_PYRAMIDS: + FixLandOwnershipTiles({ {93, 105}, {63, 34}, {76, 25}, {85, 31}, {96, 47}, {96, 48} }); + break; + case SC_UTOPIA: + FixLandOwnershipTiles({ {85, 73} }); + break; + case SC_URBAN_PARK: + FixLandOwnershipTiles({ {64, 77}, {61, 66}, {61, 67}, {39, 20} }); + break; + } + } + + void FixLandOwnershipTiles(std::initializer_list tiles) + { + + rct_map_element * currentElement; + for (const rct_xy8 * tile = tiles.begin(); tile != tiles.end(); ++tile) + { + currentElement = map_get_surface_element_at((*tile).x, (*tile).y); + currentElement->properties.surface.ownership |= OWNERSHIP_AVAILABLE; } } diff --git a/src/openrct2/scenario/ScenarioSources.cpp b/src/openrct2/scenario/ScenarioSources.cpp index be6c84075a..7fe645f95d 100644 --- a/src/openrct2/scenario/ScenarioSources.cpp +++ b/src/openrct2/scenario/ScenarioSources.cpp @@ -62,7 +62,7 @@ namespace ScenarioSources { { SC_FOREST_FRONTIERS, "Forest Frontiers", SCENARIO_CATEGORY_BEGINNER }, { SC_DYNAMITE_DUNES, "Dynamite Dunes", SCENARIO_CATEGORY_BEGINNER }, - { SC_LEAFY_LAKES, "Leafy Lake", SCENARIO_CATEGORY_BEGINNER }, + { SC_LEAFY_LAKE, "Leafy Lake", SCENARIO_CATEGORY_BEGINNER }, { SC_DIAMOND_HEIGHTS, "Diamond Heights", SCENARIO_CATEGORY_BEGINNER }, { SC_EVERGREEN_GARDENS, "Evergreen Gardens", SCENARIO_CATEGORY_BEGINNER }, { SC_BUMBLY_BEACH, "Bumbly Beach", SCENARIO_CATEGORY_BEGINNER }, diff --git a/src/openrct2/scenario/ScenarioSources.h b/src/openrct2/scenario/ScenarioSources.h index caa7d6f3c4..f3b900254a 100644 --- a/src/openrct2/scenario/ScenarioSources.h +++ b/src/openrct2/scenario/ScenarioSources.h @@ -59,7 +59,7 @@ enum // RCT SC_FOREST_FRONTIERS = 0, SC_DYNAMITE_DUNES, - SC_LEAFY_LAKES, + SC_LEAFY_LAKE, SC_DIAMOND_HEIGHTS, SC_EVERGREEN_GARDENS, SC_BUMBLY_BEACH,