From 2ef549b05584e62767e421b8cb2af7887f270d1c Mon Sep 17 00:00:00 2001 From: Ted John Date: Thu, 26 Apr 2018 22:00:48 +0100 Subject: [PATCH] Fix #7450: Only 3 standard entertainer costumes can be chosen String value rather than string arrays were not being processed for enterainer costumes in object json files. --- src/openrct2/object/SceneryGroupObject.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/openrct2/object/SceneryGroupObject.cpp b/src/openrct2/object/SceneryGroupObject.cpp index f5701af989..af5c414b42 100644 --- a/src/openrct2/object/SceneryGroupObject.cpp +++ b/src/openrct2/object/SceneryGroupObject.cpp @@ -154,12 +154,10 @@ void SceneryGroupObject::ReadJson(IReadObjectContext * context, const json_t * r uint32 SceneryGroupObject::ReadJsonEntertainerCostumes(const json_t * jCostumes) { uint32 costumes = 0; - size_t index; - json_t * jCostume; - json_array_foreach(jCostumes, index, jCostume) + auto szCostumes = ObjectJsonHelpers::GetJsonStringArray(jCostumes); + for (const auto& szCostume : szCostumes) { - auto costume = ObjectJsonHelpers::GetString(jCostume); - auto entertainer = ParseEntertainerCostume(costume); + auto entertainer = ParseEntertainerCostume(szCostume); // For some reason the flags are +4 from the actual costume IDs // See staff_get_available_entertainer_costumes