mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-04 13:42:55 +01:00
Fix #22633: Crash when drawing loading screen with an outdated g2.dat
This commit is contained in:
committed by
GitHub
parent
8a9d5edc2d
commit
1ccef10b19
@@ -1,6 +1,7 @@
|
||||
0.4.16 (in development)
|
||||
------------------------------------------------------------------------
|
||||
- Fix: [#22615] Crash when drawing Space Rings with an invalid ride entry.
|
||||
- Fix: [#22633] Crash when drawing loading screen with an outdated g2.dat.
|
||||
- Fix: [#22918] Zooming with keyboard moves the view off centre.
|
||||
- Fix: [#22921] Wooden RollerCoaster flat to steep railings appear in front of track in front of them.
|
||||
- Fix: [#22962] Fuzzy horizontal-to-vertical line transitions in charts.
|
||||
|
||||
@@ -194,11 +194,12 @@ namespace OpenRCT2::Ui::Windows
|
||||
|
||||
// Figure out where to position the vehicle to indicate progress
|
||||
auto* vehicle = GfxGetG1Element(variant.vehicle);
|
||||
int16_t vehicleWidth = (vehicle != nullptr) ? vehicle->width : 0;
|
||||
int32_t position;
|
||||
if (_totalCount > 0)
|
||||
position = (-vehicle->width + 2) + width * _currentProgress / _totalCount;
|
||||
position = (-vehicleWidth + 2) + width * _currentProgress / _totalCount;
|
||||
else
|
||||
position = (vehicle->width + width) / 2;
|
||||
position = (vehicleWidth + width) / 2;
|
||||
|
||||
GfxDrawSprite(clipDPI, variant.vehicle, ScreenCoordsXY(position, widget.bottom + 1));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user