mirror of https://github.com/OpenRCT2/OpenRCT2.git
Re-calculate the amount of guests heading to the park on import
This commit is contained in:
parent
a45d72f562
commit
4e7587db13
|
@ -345,6 +345,21 @@ void RCT2StringToUTF8Self(char* buffer, size_t length)
|
|||
}
|
||||
}
|
||||
|
||||
static void FixGuestsHeadingToParkCount()
|
||||
{
|
||||
uint32_t guestsHeadingToPark = 0;
|
||||
|
||||
for (auto* peep : EntityList<Guest>())
|
||||
{
|
||||
if (peep->OutsideOfPark && peep->State != PeepState::LeavingPark)
|
||||
{
|
||||
guestsHeadingToPark++;
|
||||
}
|
||||
}
|
||||
|
||||
gNumGuestsHeadingForPark = guestsHeadingToPark;
|
||||
}
|
||||
|
||||
static void FixGuestCount()
|
||||
{
|
||||
// Recalculates peep count after loading a save to fix corrupted files
|
||||
|
@ -454,6 +469,8 @@ static void FixInvalidSurfaces()
|
|||
// For example recalculate guest count by looking at all the guests instead of trusting the value in the file.
|
||||
void GameFixSaveVars()
|
||||
{
|
||||
FixGuestsHeadingToParkCount();
|
||||
|
||||
FixGuestCount();
|
||||
|
||||
FixPeepsWithInvalidRideReference();
|
||||
|
|
Loading…
Reference in New Issue