From 9dba4a87cca3d796006c47e225ff4ea80c84ed8d Mon Sep 17 00:00:00 2001 From: Ted John Date: Sun, 8 Apr 2018 18:45:38 +0100 Subject: [PATCH] Fix #7389: Path items cannot be placed on sloped paths Handle isAllowedOnQueue and isAllowedOnSlope separately --- src/openrct2/object/FootpathItemObject.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/openrct2/object/FootpathItemObject.cpp b/src/openrct2/object/FootpathItemObject.cpp index 97a5fee55e..ff4c6260fd 100644 --- a/src/openrct2/object/FootpathItemObject.cpp +++ b/src/openrct2/object/FootpathItemObject.cpp @@ -113,10 +113,19 @@ void FootpathItemObject::ReadJson(IReadObjectContext * context, const json_t * r { "isLamp", PATH_BIT_FLAG_LAMP }, { "isJumpingFountainWater", PATH_BIT_FLAG_JUMPING_FOUNTAIN_WATER }, { "isJumpingFountainSnow", PATH_BIT_FLAG_JUMPING_FOUNTAIN_SNOW }, - { "isAllowedOnQueue", PATH_BIT_FLAG_DONT_ALLOW_ON_QUEUE }, - { "isAllowedOnSlope", PATH_BIT_FLAG_DONT_ALLOW_ON_SLOPE }, { "isTelevision", PATH_BIT_FLAG_IS_QUEUE_SCREEN }}); + // HACK To avoid 'negated' properties in JSON, handle these separately until + // flags are inverted in this code base. + if (!ObjectJsonHelpers::GetBoolean(properties, "isAllowedOnQueue", false)) + { + _legacyType.path_bit.flags |= PATH_BIT_FLAG_DONT_ALLOW_ON_QUEUE; + } + if (!ObjectJsonHelpers::GetBoolean(properties, "isAllowedOnSlope", false)) + { + _legacyType.path_bit.flags |= PATH_BIT_FLAG_DONT_ALLOW_ON_SLOPE; + } + ObjectJsonHelpers::LoadStrings(root, GetStringTable()); ObjectJsonHelpers::LoadImages(context, root, GetImageTable()); }