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:
@@ -337,6 +337,9 @@ void GameFixSaveVars()
|
||||
UpdateConsolidatedPatrolAreas();
|
||||
|
||||
MapCountRemainingLandRights();
|
||||
|
||||
// Update sprite bounds, rather than relying on stored data
|
||||
PeepUpdateAllBoundingBoxes();
|
||||
}
|
||||
|
||||
void GameLoadInit()
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -436,6 +436,7 @@ extern const bool gAnimationGroupToSlowWalkMap[48];
|
||||
|
||||
int32_t PeepGetStaffCount();
|
||||
void PeepUpdateAll();
|
||||
void PeepUpdateAllBoundingBoxes();
|
||||
void PeepProblemWarningsUpdate();
|
||||
void PeepStopCrowdNoise();
|
||||
void PeepUpdateCrowdNoise();
|
||||
|
||||
Reference in New Issue
Block a user