1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-19 04:53:12 +01:00

Fix #6846: Ride overview window zoom level set too high

This commit is contained in:
rwjuk
2017-12-27 16:47:06 +00:00
committed by Michael Steenbeek
parent 6b2a0063ee
commit 29c604d850
2 changed files with 3 additions and 1 deletions

View File

@@ -1486,7 +1486,8 @@ static void window_ride_update_overall_view(uint8 ride_index) {
// Each farther zoom level shows twice as many tiles (log)
// Appropriate zoom is lowered by one to fill the entire view with the ride
double zoom = ceil(log(size / 80)) - 1;
// Value clamped to a minimum of 0 to prevent underflow
sint32 zoom = Math::Max((sint32)ceil(log(size / 80)) - 1, 0);
view->zoom = Math::Clamp<uint8>(0, zoom, 3);
}