1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-20 13:33:02 +01:00

Reset all peep sprite bounds at save file import time

This commit is contained in:
Aaron van Geffen
2024-12-17 20:40:49 +01:00
parent e18abdd6a4
commit 91cf22aede
3 changed files with 18 additions and 1 deletions

View File

@@ -337,6 +337,9 @@ void GameFixSaveVars()
UpdateConsolidatedPatrolAreas();
MapCountRemainingLandRights();
// Update sprite bounds, rather than relying on stored data
PeepUpdateAllBoundingBoxes();
}
void GameLoadInit()

View File

@@ -244,6 +244,19 @@ void PeepUpdateAll()
}
}
void PeepUpdateAllBoundingBoxes()
{
for (auto* peep : EntityList<Guest>())
{
peep->UpdateSpriteBoundingBox();
}
for (auto* peep : EntityList<Staff>())
{
peep->UpdateSpriteBoundingBox();
}
}
/*
* rct2: 0x68F3AE
* Set peep state to falling if path below has gone missing, return true if current path is valid, false if peep starts falling.
@@ -360,7 +373,7 @@ void Peep::UpdateCurrentAnimationType()
void Peep::UpdateSpriteBoundingBox()
{
const& auto spriteBounds = GetSpriteBounds(AnimationGroup, AnimationType);
const auto& spriteBounds = GetSpriteBounds(AnimationGroup, AnimationType);
SpriteData.Width = spriteBounds.sprite_width;
SpriteData.HeightMin = spriteBounds.sprite_height_negative;
SpriteData.HeightMax = spriteBounds.sprite_height_positive;

View File

@@ -436,6 +436,7 @@ extern const bool gAnimationGroupToSlowWalkMap[48];
int32_t PeepGetStaffCount();
void PeepUpdateAll();
void PeepUpdateAllBoundingBoxes();
void PeepProblemWarningsUpdate();
void PeepStopCrowdNoise();
void PeepUpdateCrowdNoise();