From 4174b8adcc5e8a46454264f3ad6cff879c00244c Mon Sep 17 00:00:00 2001 From: Ted John Date: Sun, 16 Dec 2018 23:08:22 +0000 Subject: [PATCH] Fix the build --- src/openrct2/ParkFile.cpp | 21 +++++++++------------ src/openrct2/world/Entrance.cpp | 12 +++--------- 2 files changed, 12 insertions(+), 21 deletions(-) diff --git a/src/openrct2/ParkFile.cpp b/src/openrct2/ParkFile.cpp index eb940d38df..495c7e04ac 100644 --- a/src/openrct2/ParkFile.cpp +++ b/src/openrct2/ParkFile.cpp @@ -335,13 +335,10 @@ namespace OpenRCT2 BeginArray(); for (const auto& spawn : gPeepSpawns) { - if (!gPeepSpawns->isNull()) - { - WriteValue(spawn.x); - WriteValue(spawn.y); - WriteValue(spawn.z); - WriteValue(spawn.direction); - } + WriteValue(spawn.x); + WriteValue(spawn.y); + WriteValue(spawn.z); + WriteValue(spawn.direction); NextArrayElement(); } EndArray(); @@ -561,6 +558,8 @@ namespace OpenRCT2 // Initial cash will eventually be removed gInitialCash = gCash; + String::Set(gS6Info.name, sizeof(gS6Info.name), gScenarioName.c_str()); + String::Set(gS6Info.details, sizeof(gS6Info.details), gScenarioName.c_str()); } private: @@ -645,11 +644,9 @@ namespace OpenRCT2 { ReadValue(); - String::Set(gScenarioName, sizeof(gScenarioName), ReadStringTable().c_str()); - String::Set(gS6Info.name, sizeof(gS6Info.name), gScenarioName); + gScenarioName = ReadStringTable(); ReadStringTable(); // park name - String::Set(gScenarioDetails, sizeof(gScenarioDetails), ReadStringTable().c_str()); - String::Set(gS6Info.details, sizeof(gS6Info.details), gScenarioName); + gScenarioDetails = ReadStringTable(); gScenarioObjectiveType = ReadValue(); gScenarioObjectiveYear = ReadValue(); // year @@ -664,7 +661,7 @@ namespace OpenRCT2 gScenarioParkRatingWarningDays = ReadValue(); gScenarioCompletedCompanyValue = ReadValue(); - String::Set(gScenarioCompletedBy, sizeof(gScenarioCompletedBy), ReadString().c_str()); + gScenarioCompletedBy = ReadString(); EndChunk(); } else diff --git a/src/openrct2/world/Entrance.cpp b/src/openrct2/world/Entrance.cpp index 23e69feaa5..a62dbd9105 100644 --- a/src/openrct2/world/Entrance.cpp +++ b/src/openrct2/world/Entrance.cpp @@ -216,9 +216,7 @@ void fix_park_entrance_locations(void) void UpdateParkEntranceLocations() { - reset_park_entrance(); - - size_t entranceIndex = 0; + gParkEntrances.clear(); tile_element_iterator it; tile_element_iterator_begin(&it); while (tile_element_iterator_next(&it)) @@ -227,16 +225,12 @@ void UpdateParkEntranceLocations() if (entranceElement != nullptr && entranceElement->GetEntranceType() == ENTRANCE_TYPE_PARK_ENTRANCE && entranceElement->GetSequenceIndex() == 0 && !entranceElement->IsGhost()) { - auto& entrance = gParkEntrances[entranceIndex]; + CoordsXYZD entrance; entrance.x = it.x * 32; entrance.y = it.y * 32; entrance.z = it.element->base_height * 8; entrance.direction = it.element->GetDirection(); - entranceIndex++; - if (entranceIndex >= MAX_PARK_ENTRANCES) - { - break; - } + gParkEntrances.push_back(entrance); } } }