Fix #14667: Unpurchaseable land tiles in Extreme Hawaiian Island

This commit is contained in:
Michael Steenbeek 2021-08-01 17:26:43 +02:00 committed by GitHub
parent 654fb83d3c
commit 864de57877
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 40 additions and 4 deletions

View File

@ -3,6 +3,7 @@
- Feature: [#15084] [Plugin] Add "vehicle.crash" hook
- Feature: [#15143] Added a shortcut key for Giant Screenshot.
- Fix: [#14316] Closing the Track Designs Manager window causes broken state.
- Fix: [#14667] “Extreme Hawaiian Island” has unpurchaseable land tiles (original bug).
- Fix: [#15096] Crash when placing entrances in the scenario editor near the map corner.
- Fix: [#15142] ToonTowner's mine roofs were moved into the pirate theme scenery group instead of the mine theme scenery group.
- Fix: [#15148] Track Designs Manager delete confirmation window doesn't display properly.

View File

@ -472,6 +472,12 @@ public:
auto& park = OpenRCT2::GetContext()->GetGameState()->GetPark();
park.Name = GetUserString(_s6.park_name);
FixLandOwnership();
research_determine_first_of_type();
}
void FixLandOwnership() const
{
if (String::Equals(_s6.scenario_filename, "Europe - European Cultural Festival.SC6"))
{
// This scenario breaks pathfinding. Create passages between the worlds. (List is grouped by neighbouring tiles.)
@ -486,8 +492,33 @@ public:
OWNERSHIP_OWNED);
// clang-format on
}
research_determine_first_of_type();
else if (String::Equals(gScenarioFileName, "N America - Extreme Hawaiian Island.SC6"))
{
FixLandOwnershipTilesWithOwnership(
{
{ 132, 124 },
{ 133, 124 },
{ 133, 125 },
{ 133, 126 },
{ 119, 35 },
{ 132, 62 },
{ 133, 67 },
{ 136, 71 },
{ 87, 33 },
{ 87, 34 },
{ 90, 36 },
{ 91, 36 },
},
OWNERSHIP_OWNED);
// We set the doNotDowngrade flag for cases where the player has used a cheat to own all land.
FixLandOwnershipTilesWithOwnership(
{
{ 49, 99 },
{ 50, 99 },
{ 88, 110 },
},
OWNERSHIP_AVAILABLE, true);
}
}
void ImportRides()

View File

@ -2494,13 +2494,16 @@ void FixLandOwnershipTiles(std::initializer_list<TileCoordsXY> tiles)
FixLandOwnershipTilesWithOwnership(tiles, OWNERSHIP_AVAILABLE);
}
void FixLandOwnershipTilesWithOwnership(std::initializer_list<TileCoordsXY> tiles, uint8_t ownership)
void FixLandOwnershipTilesWithOwnership(std::initializer_list<TileCoordsXY> tiles, uint8_t ownership, bool doNotDowngrade)
{
for (const TileCoordsXY* tile = tiles.begin(); tile != tiles.end(); ++tile)
{
auto surfaceElement = map_get_surface_element_at(tile->ToCoordsXY());
if (surfaceElement != nullptr)
{
if (doNotDowngrade && surfaceElement->GetOwnership() == OWNERSHIP_OWNED)
continue;
surfaceElement->SetOwnership(ownership);
update_park_fences_around_tile({ (*tile).x * 32, (*tile).y * 32 });
}

View File

@ -300,6 +300,7 @@ void map_obstruction_set_error_text(TileElement* tileElement, GameActions::Resul
uint16_t check_max_allowable_land_rights_for_tile(const CoordsXYZ& tileMapPos);
void FixLandOwnershipTiles(std::initializer_list<TileCoordsXY> tiles);
void FixLandOwnershipTilesWithOwnership(std::initializer_list<TileCoordsXY> tiles, uint8_t ownership);
void FixLandOwnershipTilesWithOwnership(
std::initializer_list<TileCoordsXY> tiles, uint8_t ownership, bool doNotDowngrade = false);
#endif