Reset all peep sprite bounds at save file import time

This commit is contained in:
Aaron van Geffen committed 2024-12-17 21:06:11 +01:00
1 parent e18abdd6a4
commit 91cf22aede
3 files changed
+18 -1

No files matched your search

+3
View File
@@ -337,6 +337,9 @@ void GameFixSaveVars()
UpdateConsolidatedPatrolAreas();
MapCountRemainingLandRights();
// Update sprite bounds, rather than relying on stored data
PeepUpdateAllBoundingBoxes();
}
void GameLoadInit()
+14 -1
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;
+1
View File
@@ -436,6 +436,7 @@ extern const bool gAnimationGroupToSlowWalkMap[48];
int32_t PeepGetStaffCount();
void PeepUpdateAll();
void PeepUpdateAllBoundingBoxes();
void PeepProblemWarningsUpdate();
void PeepStopCrowdNoise();
void PeepUpdateCrowdNoise();