Fix #10325: Crash when banners have no text (#10327)

* Fix #10325: Crash when banners have no text

* Update changelog.txt
This commit is contained in:
ζeh Matt 2019-12-04 11:22:07 +01:00 committed by Michael Steenbeek
parent 7bf05d4c04
commit ab5be44ccb
5 changed files with 11 additions and 10 deletions

View File

@ -2,6 +2,7 @@
------------------------------------------------------------------------
- Change: [#1164] Use available translations for shortcut key bindings.
- Fix: [#10228] Can't import RCT1 Deluxe from Steam.
- Fix: [#10325] Crash when banners have no text.
0.2.4 (2019-10-28)
------------------------------------------------------------------------

View File

@ -189,8 +189,8 @@ static void ride_entrance_exit_paint(paint_session* session, uint8_t direction,
gCurrentFontSpriteBase = FONT_SPRITE_BASE_TINY;
uint16_t string_width = gfx_get_string_width(entrance_string);
uint16_t scroll = (gCurrentTicks / 2) % string_width;
uint16_t stringWidth = gfx_get_string_width(entrance_string);
uint16_t scroll = stringWidth > 0 ? (gCurrentTicks / 2) % stringWidth : 0;
sub_98199C(
session, scrolling_text_setup(session, STR_BANNER_TEXT_FORMAT, scroll, stationObj->ScrollingMode, COLOUR_BLACK), 0,
@ -298,8 +298,8 @@ static void park_entrance_paint(paint_session* session, uint8_t direction, int32
gCurrentFontSpriteBase = FONT_SPRITE_BASE_TINY;
uint16_t string_width = gfx_get_string_width(park_name);
uint16_t scroll = (gCurrentTicks / 2) % string_width;
uint16_t stringWidth = gfx_get_string_width(park_name);
uint16_t scroll = stringWidth > 0 ? (gCurrentTicks / 2) % stringWidth : 0;
if (entrance->scrolling_mode == SCROLLING_MODE_NONE)
break;

View File

@ -440,8 +440,8 @@ void large_scenery_paint(paint_session* session, uint8_t direction, uint16_t hei
gCurrentFontSpriteBase = FONT_SPRITE_BASE_TINY;
uint16_t string_width = gfx_get_string_width(signString);
uint16_t scroll = (gCurrentTicks / 2) % string_width;
uint16_t stringWidth = gfx_get_string_width(signString);
uint16_t scroll = stringWidth > 0 ? (gCurrentTicks / 2) % stringWidth : 0;
sub_98199C(
session, scrolling_text_setup(session, STR_SCROLLING_SIGN_TEXT, scroll, scrollMode, textColour), 0, 0, 1, 1, 21,
height + 25, boxoffset.x, boxoffset.y, boxoffset.z);

View File

@ -472,8 +472,8 @@ static void sub_6A4101(
gCurrentFontSpriteBase = FONT_SPRITE_BASE_TINY;
uint16_t string_width = gfx_get_string_width(gCommonStringFormatBuffer);
uint16_t scroll = (gCurrentTicks / 2) % string_width;
uint16_t stringWidth = gfx_get_string_width(gCommonStringFormatBuffer);
uint16_t scroll = stringWidth > 0 ? (gCurrentTicks / 2) % stringWidth : 0;
sub_98199C(
session, scrolling_text_setup(session, STR_BANNER_TEXT_FORMAT, scroll, scrollingMode, COLOUR_BLACK), 0, 0, 1, 1,

View File

@ -442,8 +442,8 @@ void fence_paint(paint_session* session, uint8_t direction, int32_t height, cons
gCurrentFontSpriteBase = FONT_SPRITE_BASE_TINY;
uint16_t string_width = gfx_get_string_width(signString);
uint16_t scroll = (gCurrentTicks / 2) % string_width;
uint16_t stringWidth = gfx_get_string_width(signString);
uint16_t scroll = stringWidth > 0 ? (gCurrentTicks / 2) % stringWidth : 0;
sub_98199C(
session, scrolling_text_setup(session, STR_SCROLLING_SIGN_TEXT, scroll, scrollingMode, secondaryColour), 0, 0, 1, 1,