summaryrefslogtreecommitdiffstats
path: root/src/SetChunkData.cpp
diff options
context:
space:
mode:
authorworktycho <work.tycho@gmail.com>2015-05-05 23:08:49 +0200
committerworktycho <work.tycho@gmail.com>2015-05-05 23:08:49 +0200
commit18a268a961d1a9d93fda2e4c0b18f9296f7dd768 (patch)
tree015da1c0d4fe80dc83653854d3a59a8f6a598832 /src/SetChunkData.cpp
parentMerge pull request #1917 from Woazboat/CodeCleanup (diff)
parentRevert "Small code cleanup" (diff)
downloadcuberite-18a268a961d1a9d93fda2e4c0b18f9296f7dd768.tar
cuberite-18a268a961d1a9d93fda2e4c0b18f9296f7dd768.tar.gz
cuberite-18a268a961d1a9d93fda2e4c0b18f9296f7dd768.tar.bz2
cuberite-18a268a961d1a9d93fda2e4c0b18f9296f7dd768.tar.lz
cuberite-18a268a961d1a9d93fda2e4c0b18f9296f7dd768.tar.xz
cuberite-18a268a961d1a9d93fda2e4c0b18f9296f7dd768.tar.zst
cuberite-18a268a961d1a9d93fda2e4c0b18f9296f7dd768.zip
Diffstat (limited to '')
-rw-r--r--src/SetChunkData.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/SetChunkData.cpp b/src/SetChunkData.cpp
index 7549b0dbf..f2b58570d 100644
--- a/src/SetChunkData.cpp
+++ b/src/SetChunkData.cpp
@@ -103,7 +103,7 @@ void cSetChunkData::CalculateHeightMap(void)
int index = cChunkDef::MakeIndexNoCheck(x, y, z);
if (m_BlockTypes[index] != E_BLOCK_AIR)
{
- m_HeightMap[x + z * cChunkDef::Width] = static_cast<HEIGHTTYPE>(y);
+ m_HeightMap[x + z * cChunkDef::Width] = (HEIGHTTYPE)y;
break;
}
} // for y
@@ -131,8 +131,11 @@ void cSetChunkData::RemoveInvalidBlockEntities(void)
ItemTypeToString(EntityBlockType).c_str(), EntityBlockType,
ItemTypeToString(WorldBlockType).c_str(), WorldBlockType
);
+ cBlockEntityList::iterator itr2 = itr;
+ ++itr2;
delete *itr;
- itr = m_BlockEntities.erase(itr);
+ m_BlockEntities.erase(itr);
+ itr = itr2;
}
else
{