1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-15 19:13:07 +01:00

Fix #21498: Crash when the size of text can’t be determined

This commit is contained in:
Matt
2024-03-02 14:22:59 +02:00
committed by GitHub
parent a2762ed321
commit 9a100b82b4
2 changed files with 2 additions and 1 deletions

View File

@@ -31,6 +31,7 @@
- Fix: [#21347] Too many options are hidden if the platform has no file picker.
- Fix: [#21350] Maze and Mini Golf track designs from RCT1 not shown in track designs list.
- Fix: [#21425] Additional missing/misplaced land & construction rights tiles in Japanese Coastal Reclaim.
- Fix: [#21498] Crash when the size of text cant be determined.
- Fix: [objects#262, objects#263, objects#265, objects#266, objects#267, objects#268, objects#270, objects#271, objects#283] Various errors in expansion pack objects (original bug).
- Fix: [OpenSFX#18] B&M Roar sound effect not looping correctly.

View File

@@ -68,7 +68,7 @@ static void PaintBannerScrollingText(
}
auto stringWidth = GfxGetStringWidth(text, FontStyle::Tiny);
auto scroll = (GetGameState().CurrentTicks / 2) % stringWidth;
auto scroll = stringWidth > 0 ? (GetGameState().CurrentTicks / 2) % stringWidth : 0;
auto imageId = ScrollingTextSetup(session, STR_BANNER_TEXT_FORMAT, ft, scroll, scrollingMode, COLOUR_BLACK);
PaintAddImageAsChild(session, imageId, { 0, 0, height + 22 }, { bbOffset, { 1, 1, 21 } });
}