diff options
Diffstat (limited to 'src/Generating')
-rw-r--r-- | src/Generating/ChunkDesc.cpp | 14 | ||||
-rw-r--r-- | src/Generating/ChunkDesc.h | 4 | ||||
-rw-r--r-- | src/Generating/CompoGenBiomal.cpp | 5 | ||||
-rw-r--r-- | src/Generating/MineShafts.cpp | 2 | ||||
-rw-r--r-- | src/Generating/MineShafts.h | 2 |
5 files changed, 15 insertions, 12 deletions
diff --git a/src/Generating/ChunkDesc.cpp b/src/Generating/ChunkDesc.cpp index b2a332489..397220f4f 100644 --- a/src/Generating/ChunkDesc.cpp +++ b/src/Generating/ChunkDesc.cpp @@ -573,12 +573,12 @@ void cChunkDesc::RandomFillRelCuboid( cBlockEntity * cChunkDesc::GetBlockEntity(int a_RelX, int a_RelY, int a_RelZ) { const auto Idx = cChunkDef::MakeIndex(a_RelX, a_RelY, a_RelZ); - const auto itr = m_BlockEntities.find(Idx); + const auto Iterator = m_BlockArea.GetBlockEntities().find(Idx); - if (itr != m_BlockEntities.end()) + if (Iterator != m_BlockArea.GetBlockEntities().end()) { // Already in the list: - cBlockEntity * BlockEntity = itr->second.get(); + cBlockEntity * BlockEntity = Iterator->second.get(); if (BlockEntity->GetBlockType() == GetBlockType(a_RelX, a_RelY, a_RelZ)) { // Correct type, already present. Return it: @@ -587,7 +587,7 @@ cBlockEntity * cChunkDesc::GetBlockEntity(int a_RelX, int a_RelY, int a_RelZ) else { // Wrong type, the block type has been overwritten. Erase and create new: - m_BlockEntities.erase(itr); + m_BlockArea.GetBlockEntities().erase(Iterator); } } @@ -595,13 +595,13 @@ cBlockEntity * cChunkDesc::GetBlockEntity(int a_RelX, int a_RelY, int a_RelZ) int AbsZ = a_RelZ + m_Coords.m_ChunkZ * cChunkDef::Width; // The block entity is not created yet, try to create it and add to list: - auto be = cBlockEntity::CreateByBlockType(GetBlockType(a_RelX, a_RelY, a_RelZ), GetBlockMeta(a_RelX, a_RelY, a_RelZ), {AbsX, a_RelY, AbsZ}); - if (be == nullptr) + auto BlockEntity = cBlockEntity::CreateByBlockType(GetBlockType(a_RelX, a_RelY, a_RelZ), GetBlockMeta(a_RelX, a_RelY, a_RelZ), {AbsX, a_RelY, AbsZ}); + if (BlockEntity == nullptr) { // No block entity for this block type return nullptr; } - auto res = m_BlockEntities.emplace(Idx, std::move(be)); + auto res = m_BlockArea.GetBlockEntities().emplace(Idx, std::move(BlockEntity)); return res.first->second.get(); } diff --git a/src/Generating/ChunkDesc.h b/src/Generating/ChunkDesc.h index d066660f1..519dbe81c 100644 --- a/src/Generating/ChunkDesc.h +++ b/src/Generating/ChunkDesc.h @@ -238,7 +238,8 @@ public: inline BlockNibbleBytes & GetBlockMetasUncompressed(void) { return *(reinterpret_cast<BlockNibbleBytes *>(m_BlockArea.GetBlockMetas())); } inline cChunkDef::HeightMap & GetHeightMap (void) { return m_HeightMap; } inline cEntityList & GetEntities (void) { return m_Entities; } - inline cBlockEntities & GetBlockEntities (void) { return m_BlockEntities; } + inline const cBlockEntities & GetBlockEntities (void) const { return m_BlockArea.GetBlockEntities(); } + inline cBlockEntities & GetBlockEntities (void) { return m_BlockArea.GetBlockEntities(); } inline const cChunkDef::BiomeMap & GetBiomeMap() const { return m_BiomeMap; } inline const cChunkDef::BlockTypes & GetBlockTypes() const { return *(reinterpret_cast<cChunkDef::BlockTypes *>(m_BlockArea.GetBlockTypes())); } @@ -259,7 +260,6 @@ private: cBlockArea m_BlockArea; cChunkDef::HeightMap m_HeightMap; cEntityList m_Entities; - cBlockEntities m_BlockEntities; // Individual block entities are NOT owned by this object! bool m_bUseDefaultBiomes; bool m_bUseDefaultHeight; diff --git a/src/Generating/CompoGenBiomal.cpp b/src/Generating/CompoGenBiomal.cpp index 967a4a89c..fb7b89422 100644 --- a/src/Generating/CompoGenBiomal.cpp +++ b/src/Generating/CompoGenBiomal.cpp @@ -456,7 +456,10 @@ protected: } HasHadWater = true; } // for y - a_ChunkDesc.SetBlockType(a_RelX, 0, a_RelZ, E_BLOCK_BEDROCK); + if (a_ShapeColumn[0] > 0) + { + a_ChunkDesc.SetBlockType(a_RelX, 0, a_RelZ, E_BLOCK_BEDROCK); + } } diff --git a/src/Generating/MineShafts.cpp b/src/Generating/MineShafts.cpp index 189b28095..beb1e24a1 100644 --- a/src/Generating/MineShafts.cpp +++ b/src/Generating/MineShafts.cpp @@ -26,7 +26,7 @@ in a depth-first processing. Each of the descendants will branch randomly, if no -class cMineShaft abstract +class cMineShaft { public: enum eKind diff --git a/src/Generating/MineShafts.h b/src/Generating/MineShafts.h index 43eff2055..6c137fed8 100644 --- a/src/Generating/MineShafts.h +++ b/src/Generating/MineShafts.h @@ -35,7 +35,7 @@ protected: class cMineShaftSystem; // fwd: MineShafts.cpp int m_GridSize; ///< Average spacing of the systems - int m_MaxSystemSize; ///< Maximum blcok size of a mineshaft system + int m_MaxSystemSize; ///< Maximum block size of a mineshaft system int m_ProbLevelCorridor; ///< Probability level of a branch object being the corridor int m_ProbLevelCrossing; ///< Probability level of a branch object being the crossing, minus Corridor int m_ProbLevelStaircase; ///< Probability level of a branch object being the staircase, minus Crossing |