diff options
author | Daniel O'Brien <marmot.daniel@gmail.com> | 2013-11-15 14:07:42 +0100 |
---|---|---|
committer | Daniel O'Brien <marmot.daniel@gmail.com> | 2013-11-15 14:07:42 +0100 |
commit | 5e3614ce873c56c5aefbcf3a073e7ba58c5a7859 (patch) | |
tree | 9b222b739ce4ef5e6062872b6f174e013cd208c7 /source/Generating/ChunkDesc.cpp | |
parent | added cProtocol function to pass xp to client (diff) | |
parent | APIDump: Small fixes and additions. (diff) | |
download | cuberite-5e3614ce873c56c5aefbcf3a073e7ba58c5a7859.tar cuberite-5e3614ce873c56c5aefbcf3a073e7ba58c5a7859.tar.gz cuberite-5e3614ce873c56c5aefbcf3a073e7ba58c5a7859.tar.bz2 cuberite-5e3614ce873c56c5aefbcf3a073e7ba58c5a7859.tar.lz cuberite-5e3614ce873c56c5aefbcf3a073e7ba58c5a7859.tar.xz cuberite-5e3614ce873c56c5aefbcf3a073e7ba58c5a7859.tar.zst cuberite-5e3614ce873c56c5aefbcf3a073e7ba58c5a7859.zip |
Diffstat (limited to '')
-rw-r--r-- | source/Generating/ChunkDesc.cpp | 9 |
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[] |