diff --git a/src/openrct2/object/SmallSceneryObject.cpp b/src/openrct2/object/SmallSceneryObject.cpp index f9c2a49730..4294c20fae 100644 --- a/src/openrct2/object/SmallSceneryObject.cpp +++ b/src/openrct2/object/SmallSceneryObject.cpp @@ -17,10 +17,12 @@ #include "../core/IStream.hpp" #include "../core/Math.hpp" #include "../core/Memory.hpp" +#include "../core/String.hpp" #include "SmallSceneryObject.h" #include "../drawing/drawing.h" #include "../localisation/language.h" +#include "../world/scenery.h" SmallSceneryObject::~SmallSceneryObject() { @@ -81,6 +83,8 @@ void SmallSceneryObject::Load() { _legacyType.small_scenery.frame_offsets = _frameOffsets; } + + PerformFixes(); } void SmallSceneryObject::Unload() @@ -150,3 +154,23 @@ uint8 * SmallSceneryObject::ReadFrameOffsets(IStream * stream) data.push_back(frameOffset); return Memory::Duplicate(data.data(), data.size()); } + +void SmallSceneryObject::PerformFixes() +{ + std::string identifier = GetIdentifier(); + + // ToonTowner's base blocks. Make them allow supports on top and put them in the Walls and Roofs group. + if (String::Equals(identifier, "XXBBCL01") || + String::Equals(identifier, "XXBBMD01") || + String::Equals(identifier, "XXBBBR01") || + String::Equals(identifier, "ARBASE2 ")) + { + static const rct_object_entry * scgWalls = object_list_find_by_name("SCGWALLS"); + if (scgWalls != nullptr) + { + SetPrimarySceneryGroup((rct_object_entry *)scgWalls); + } + + _legacyType.small_scenery.flags |= SMALL_SCENERY_FLAG_BUILD_DIRECTLY_ONTOP; + } +} diff --git a/src/openrct2/object/SmallSceneryObject.h b/src/openrct2/object/SmallSceneryObject.h index ee7a7a869a..daaa21dd50 100644 --- a/src/openrct2/object/SmallSceneryObject.h +++ b/src/openrct2/object/SmallSceneryObject.h @@ -42,6 +42,7 @@ public: private: static uint8 * ReadFrameOffsets(IStream * stream); + void PerformFixes(); }; #endif diff --git a/src/openrct2/world/scenery.h b/src/openrct2/world/scenery.h index fd6585d5d0..2097608776 100644 --- a/src/openrct2/world/scenery.h +++ b/src/openrct2/world/scenery.h @@ -73,7 +73,7 @@ typedef enum { SMALL_SCENERY_FLAG_NO_SUPPORTS = (1 << 20), // 0x100000 SMALL_SCENERY_FLAG_VISIBLE_WHEN_ZOOMED = (1 << 21), // 0x200000 SMALL_SCENERY_FLAG_COG = (1 << 22), // 0x400000 - SMALL_SCENERY_FLAG_BUILD_DIRECTLY_ONTOP = (1 << 23), // 0x800000 + SMALL_SCENERY_FLAG_BUILD_DIRECTLY_ONTOP = (1 << 23), // 0x800000; means supports can be built on this object. Used for base blocks. SMALL_SCENERY_FLAG_HALF_SPACE = (1 << 24), // 0x1000000 SMALL_SCENERY_FLAG_THREE_QUARTERS = (1 << 25), // 0x2000000 SMALL_SCENERY_FLAG_PAINT_SUPPORTS = (1 << 26), // 0x4000000; used for scenery items which are support structures