diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 494472ddaf..1765da97a3 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -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. diff --git a/src/openrct2-ui/windows/ProgressWindow.cpp b/src/openrct2-ui/windows/ProgressWindow.cpp index 95adab9b1d..0ca872e532 100644 --- a/src/openrct2-ui/windows/ProgressWindow.cpp +++ b/src/openrct2-ui/windows/ProgressWindow.cpp @@ -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)); }