summaryrefslogtreecommitdiffstats
path: root/source/Generating/ChunkDesc.cpp
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2013-11-15 11:33:24 +0100
committermadmaxoft <github@xoft.cz>2013-11-15 11:33:24 +0100
commitee1ac65e541cc8f57cca644288d560b43e20e1e0 (patch)
treedd8bb83f3b7e34d057c1f729e8f0a6123cfabf7a /source/Generating/ChunkDesc.cpp
parentDebuggers: Removed the old OnChunkGenerated code testing the cBlockArea writing. (diff)
downloadcuberite-ee1ac65e541cc8f57cca644288d560b43e20e1e0.tar
cuberite-ee1ac65e541cc8f57cca644288d560b43e20e1e0.tar.gz
cuberite-ee1ac65e541cc8f57cca644288d560b43e20e1e0.tar.bz2
cuberite-ee1ac65e541cc8f57cca644288d560b43e20e1e0.tar.lz
cuberite-ee1ac65e541cc8f57cca644288d560b43e20e1e0.tar.xz
cuberite-ee1ac65e541cc8f57cca644288d560b43e20e1e0.tar.zst
cuberite-ee1ac65e541cc8f57cca644288d560b43e20e1e0.zip
Diffstat (limited to 'source/Generating/ChunkDesc.cpp')
-rw-r--r--source/Generating/ChunkDesc.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/source/Generating/ChunkDesc.cpp b/source/Generating/ChunkDesc.cpp
index 039f30d9c..9fb306996 100644
--- a/source/Generating/ChunkDesc.cpp
+++ b/source/Generating/ChunkDesc.cpp
@@ -535,7 +535,14 @@ cBlockEntity * cChunkDesc::GetBlockEntity(int a_RelX, int a_RelY, int a_RelZ)
{
if (((*itr)->GetPosX() == AbsX) && ((*itr)->GetPosY() == a_RelY) && ((*itr)->GetPosZ() == AbsZ))
{
- // Already in the list, return it:
+ // Already in the list:
+ if ((*itr)->GetBlockType() != GetBlockType(a_RelX, a_RelY, a_RelZ))
+ {
+ // Wrong type, the block type has been overwritten. Erase and create new:
+ m_BlockEntities.erase(itr);
+ break;
+ }
+ // Correct type, already present. Return it:
return *itr;
}
} // for itr - m_BlockEntities[]