1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-06 06:32:56 +01:00

Fix #7389: Path items cannot be placed on sloped paths

Handle isAllowedOnQueue and isAllowedOnSlope separately
This commit is contained in:
Ted John
2018-04-08 18:45:38 +01:00
parent cc256997ef
commit 9dba4a87cc

View File

@@ -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());
}