1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-21 14:02:59 +01:00

Allow 4 active awards for more than 1 month at a time

This commit is contained in:
73
2023-01-02 14:38:29 -05:00
committed by GitHub
parent 73738bbdc8
commit bf3cc83a7a
2 changed files with 15 additions and 15 deletions

View File

@@ -606,6 +606,20 @@ void award_update_all()
{
PROFILED_FUNCTION();
// Decrease award times
for (auto& award : _currentAwards)
{
--award.Time;
}
// Remove any 0 time awards
auto res = std::remove_if(
std::begin(_currentAwards), std::end(_currentAwards), [](const Award& award) { return award.Time == 0; });
if (res != std::end(_currentAwards))
{
_currentAwards.erase(res, std::end(_currentAwards));
window_invalidate_by_class(WindowClass::ParkInformation);
}
// Only add new awards if park is open
if (gParkFlags & PARK_FLAGS_PARK_OPEN)
{
@@ -639,19 +653,4 @@ void award_update_all()
}
}
}
// Decrease award times
for (auto& award : _currentAwards)
{
--award.Time;
}
// Remove any 0 time awards
auto res = std::remove_if(
std::begin(_currentAwards), std::end(_currentAwards), [](const Award& award) { return award.Time == 0; });
if (res != std::end(_currentAwards))
{
_currentAwards.erase(res, std::end(_currentAwards));
window_invalidate_by_class(WindowClass::ParkInformation);
}
}