diff options
Diffstat (limited to 'src/Generating/Prefab.cpp')
-rw-r--r-- | src/Generating/Prefab.cpp | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/src/Generating/Prefab.cpp b/src/Generating/Prefab.cpp index 7c8c3c0bc..0a7b2a89b 100644 --- a/src/Generating/Prefab.cpp +++ b/src/Generating/Prefab.cpp @@ -157,8 +157,24 @@ void cPrefab::Draw(cChunkDesc & a_Dest, const Vector3i & a_Placement, int a_NumR return; } - // Write the image: - a_Dest.WriteBlockArea(Image, Placement.x, Placement.y, Placement.z, m_MergeStrategy); + if (m_Modifiers.size() == 0) + { + // Write the image: + a_Dest.WriteBlockArea(Image, Placement.x, Placement.y, Placement.z, m_MergeStrategy); + } + else + { + cBlockArea RandomizedImage; + Image.CopyTo(RandomizedImage); + + for (size_t i = 0; i < m_Modifiers.size(); i++) + { + m_Modifiers[i]->Modify(RandomizedImage, a_Placement, a_NumRotations); + } + + // Write the modified image: + a_Dest.WriteBlockArea(RandomizedImage, Placement.x, Placement.y, Placement.z, m_MergeStrategy); + } // If requested, draw the floor (from the bottom of the prefab down to the nearest non-air) switch (m_ExtendFloorStrategy) |