Fix #8524: Do not show RCT1 land edges when CSG1 is not loaded (#8845)

This commit is contained in:
Michael Steenbeek 2019-03-12 09:23:17 +01:00 committed by GitHub
parent f4526dd2ae
commit 18ac3b02b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 1 deletions

View File

@ -98,7 +98,7 @@ void land_tool_show_edge_style_dropdown(rct_window* w, rct_widget* widget, uint8
for (size_t i = 0; i < MAX_TERRAIN_EDGE_OBJECTS; i++)
{
const auto edgeObj = static_cast<TerrainEdgeObject*>(objManager.GetLoadedObject(OBJECT_TYPE_TERRAIN_EDGE, i));
if (edgeObj != nullptr)
if (edgeObj != nullptr && edgeObj->NumImagesLoaded > 1)
{
gDropdownItemsFormat[itemIndex] = DROPDOWN_FORMAT_LAND_PICKER;
gDropdownItemsArgs[itemIndex] = edgeObj->IconImageId;

View File

@ -51,4 +51,5 @@ void TerrainEdgeObject::ReadJson(IReadObjectContext* context, const json_t* root
ObjectJsonHelpers::LoadStrings(root, GetStringTable());
ObjectJsonHelpers::LoadImages(context, root, GetImageTable());
NumImagesLoaded = GetImageTable().GetCount();
}

View File

@ -18,6 +18,7 @@ public:
rct_string_id NameStringId{};
uint32_t IconImageId{};
uint32_t BaseImageId{};
uint32_t NumImagesLoaded{};
explicit TerrainEdgeObject(const rct_object_entry& entry)
: Object(entry)