From c92792a973ac4ef90497d75966d4e78b030e5ef3 Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Thu, 26 Jan 2017 23:02:29 +0100 Subject: [PATCH] Also import news items in S4 files correctly --- src/openrct2/game.c | 20 +++++++++++++------- src/openrct2/game.h | 1 + src/openrct2/rct1/S4Importer.cpp | 1 + 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/openrct2/game.c b/src/openrct2/game.c index 1a0566266a..152be822cb 100644 --- a/src/openrct2/game.c +++ b/src/openrct2/game.c @@ -729,14 +729,20 @@ void game_convert_strings_to_utf8() } } - // News items - for (sint32 i = 0; i < MAX_NEWS_ITEMS; i++) { - NewsItem *newsItem = news_item_get(i); + // News items + game_convert_news_items_to_utf8(); - if (!str_is_null_or_empty(newsItem->Text)) { - rct2_to_utf8_self(newsItem->Text, sizeof(newsItem->Text)); - } - } +} + +void game_convert_news_items_to_utf8() +{ + for (sint32 i = 0; i < MAX_NEWS_ITEMS; i++) { + NewsItem *newsItem = news_item_get(i); + + if (!str_is_null_or_empty(newsItem->Text)) { + rct2_to_utf8_self(newsItem->Text, sizeof(newsItem->Text)); + } + } } /** diff --git a/src/openrct2/game.h b/src/openrct2/game.h index bf13755535..8c70bbb44d 100644 --- a/src/openrct2/game.h +++ b/src/openrct2/game.h @@ -181,6 +181,7 @@ void rct2_exit(); void rct2_exit_reason(rct_string_id title, rct_string_id body); void game_autosave(); void game_convert_strings_to_utf8(); +void game_convert_news_items_to_utf8(); void game_convert_strings_to_rct2(rct_s6_data *s6); void game_fix_save_vars(); bool game_load_save_or_scenario(const utf8 * path); diff --git a/src/openrct2/rct1/S4Importer.cpp b/src/openrct2/rct1/S4Importer.cpp index c8a22eead9..3344ddf923 100644 --- a/src/openrct2/rct1/S4Importer.cpp +++ b/src/openrct2/rct1/S4Importer.cpp @@ -164,6 +164,7 @@ public: // Importing the strings is done later on, although that approach needs looking at. //game_convert_strings_to_utf8(); + game_convert_news_items_to_utf8(); map_count_remaining_land_rights(); }