From 0a83bb8b151ce101fa4ce609548ab3b6cb5a16b3 Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Sun, 22 Jan 2017 15:53:01 +0100 Subject: [PATCH] Fix importing custom peep/staff names, fix formatting --- src/openrct2/rct1/S4Importer.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/openrct2/rct1/S4Importer.cpp b/src/openrct2/rct1/S4Importer.cpp index 89b36e73df..e189d26451 100644 --- a/src/openrct2/rct1/S4Importer.cpp +++ b/src/openrct2/rct1/S4Importer.cpp @@ -381,7 +381,6 @@ private: case OBJECT_TYPE_WALLS: case OBJECT_TYPE_PATHS: case OBJECT_TYPE_PATH_BITS: - { EntryList * entries = GetEntryList(objectType); // Check if there are spare entries available @@ -392,7 +391,6 @@ private: } break; } - } } } } @@ -849,7 +847,20 @@ private: dst->sprite_direction = src->sprite_direction; + // Peep name dst->name_string_idx = src->name_string_idx; + if (is_user_string_id(src->name_string_idx)) + { + const char * peepName = GetUserString(src->name_string_idx); + if (peepName[0] != 0) + { + rct_string_id peepNameStringId = user_string_allocate(4, peepName); + if (peepNameStringId != 0) + { + dst->name_string_idx = peepNameStringId; + } + } + } dst->outside_of_park = src->outside_of_park;