1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-16 03:23:15 +01:00

Use std::copy for gParkRatingHistory

Co-authored-by: ζeh Matt <5415177+ZehMatt@users.noreply.github.com>
This commit is contained in:
Michael Steenbeek
2021-09-04 00:03:24 +02:00
committed by GitHub
parent 600ce959d7
commit a526caa1cb
3 changed files with 3 additions and 3 deletions

View File

@@ -2121,7 +2121,7 @@ namespace RCT1
auto& park = OpenRCT2::GetContext()->GetGameState()->GetPark();
park.ResetHistories();
std::memcpy(gParkRatingHistory, _s4.park_rating_history, sizeof(_s4.park_rating_history));
std::copy(std::begin(_s4.park_rating_history), std::end(_s4.park_rating_history), gParkRatingHistory);
for (size_t i = 0; i < std::size(_s4.guests_in_park_history); i++)
{
if (_s4.guests_in_park_history[i] != RCT12ParkHistoryUndefined)

View File

@@ -351,7 +351,7 @@ void S6Exporter::Export()
_s6.park_rating = gParkRating;
std::memcpy(_s6.park_rating_history, gParkRatingHistory, sizeof(_s6.park_rating_history));
std::copy(std::begin(gParkRatingHistory), std::end(gParkRatingHistory), _s6.park_rating_history);
std::fill(std::begin(_s6.guests_in_park_history), std::end(_s6.guests_in_park_history), RCT12ParkHistoryUndefined);
for (size_t i = 0; i < std::size(gGuestsInParkHistory); i++)
{

View File

@@ -272,7 +272,7 @@ public:
auto& park = OpenRCT2::GetContext()->GetGameState()->GetPark();
park.ResetHistories();
std::memcpy(gParkRatingHistory, _s6.park_rating_history, sizeof(_s6.park_rating_history));
std::copy(std::begin(_s6.park_rating_history), std::end(_s6.park_rating_history), gParkRatingHistory);
for (size_t i = 0; i < std::size(_s6.guests_in_park_history); i++)
{
if (_s6.guests_in_park_history[i] != RCT12ParkHistoryUndefined)