1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-28 01:04:50 +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

@@ -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 } });
}