summaryrefslogtreecommitdiffstats
path: root/src/Generating/VillageGen.cpp
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2017-02-26 22:49:23 +0100
committerMattes D <github@xoft.cz>2017-05-04 09:49:30 +0200
commit187abe3f5e2219e0a80c0cdca4db362e223b60ae (patch)
treeb68eac26b892fa469ec5753d34d4fa8a35a53bd3 /src/Generating/VillageGen.cpp
parentAPIDoc: Removed non-existent functions and added missing return types (diff)
downloadcuberite-187abe3f5e2219e0a80c0cdca4db362e223b60ae.tar
cuberite-187abe3f5e2219e0a80c0cdca4db362e223b60ae.tar.gz
cuberite-187abe3f5e2219e0a80c0cdca4db362e223b60ae.tar.bz2
cuberite-187abe3f5e2219e0a80c0cdca4db362e223b60ae.tar.lz
cuberite-187abe3f5e2219e0a80c0cdca4db362e223b60ae.tar.xz
cuberite-187abe3f5e2219e0a80c0cdca4db362e223b60ae.tar.zst
cuberite-187abe3f5e2219e0a80c0cdca4db362e223b60ae.zip
Diffstat (limited to '')
-rw-r--r--src/Generating/VillageGen.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/Generating/VillageGen.cpp b/src/Generating/VillageGen.cpp
index 6d5216a16..11617c9ec 100644
--- a/src/Generating/VillageGen.cpp
+++ b/src/Generating/VillageGen.cpp
@@ -5,7 +5,7 @@
#include "Globals.h"
#include "VillageGen.h"
-#include "PieceGenerator.h"
+#include "PieceGeneratorBFSTree.h"
@@ -133,7 +133,7 @@ public:
m_HeightGen(a_HeightGen)
{
// Generate the pieces for this village; don't care about the Y coord:
- cBFSPieceGenerator pg(*this, a_Seed);
+ cPieceGeneratorBFSTree pg(*this, a_Seed);
pg.PlacePieces(a_OriginX, a_OriginZ, a_MaxRoadDepth + 1, m_Pieces);
if (m_Pieces.empty())
{
@@ -141,10 +141,6 @@ public:
}
}
- ~cVillage()
- {
- cPieceGenerator::FreePieces(m_Pieces);
- }
protected:
/** Seed for the random functions */
@@ -193,7 +189,7 @@ protected:
{
PlacePieceOnGround(**itr);
}
- Prefab.Draw(a_Chunk, *itr);
+ Prefab.Draw(a_Chunk, itr->get());
} // for itr - m_PlacedPieces[]
}
@@ -304,11 +300,11 @@ protected:
void MoveAllDescendants(cPlacedPieces & a_PlacedPieces, size_t a_Pivot, int a_HeightDifference)
{
size_t num = a_PlacedPieces.size();
- cPlacedPiece * Pivot = a_PlacedPieces[a_Pivot];
+ auto & Pivot = a_PlacedPieces[a_Pivot];
for (size_t i = a_Pivot + 1; i < num; i++)
{
if (
- (a_PlacedPieces[i]->GetParent() == Pivot) && // It is a direct dependant of the pivot
+ (a_PlacedPieces[i]->GetParent() == Pivot.get()) && // It is a direct dependant of the pivot
!(static_cast<const cPrefab &>(a_PlacedPieces[i]->GetPiece())).ShouldMoveToGround() // It attaches strictly by connectors
)
{