diff options
author | peterbell10 <peterbell10@live.co.uk> | 2020-04-03 23:23:38 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-03 23:23:38 +0200 |
commit | aac592f98598aae327d07b2a1bb155e33c6d51b1 (patch) | |
tree | 24f90211d753a7ec87585e919ef7c7acdfa49909 /src/SetChunkData.cpp | |
parent | New hotfix to prevent calling OnBroken (#4600) (diff) | |
download | cuberite-aac592f98598aae327d07b2a1bb155e33c6d51b1.tar cuberite-aac592f98598aae327d07b2a1bb155e33c6d51b1.tar.gz cuberite-aac592f98598aae327d07b2a1bb155e33c6d51b1.tar.bz2 cuberite-aac592f98598aae327d07b2a1bb155e33c6d51b1.tar.lz cuberite-aac592f98598aae327d07b2a1bb155e33c6d51b1.tar.xz cuberite-aac592f98598aae327d07b2a1bb155e33c6d51b1.tar.zst cuberite-aac592f98598aae327d07b2a1bb155e33c6d51b1.zip |
Diffstat (limited to '')
-rw-r--r-- | src/SetChunkData.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/SetChunkData.cpp b/src/SetChunkData.cpp index 19448147a..d27e53d1c 100644 --- a/src/SetChunkData.cpp +++ b/src/SetChunkData.cpp @@ -131,7 +131,7 @@ void cSetChunkData::RemoveInvalidBlockEntities(void) { for (cBlockEntities::iterator itr = m_BlockEntities.begin(); itr != m_BlockEntities.end();) { - cBlockEntity * BlockEntity = itr->second; + auto & BlockEntity = itr->second; BLOCKTYPE EntityBlockType = BlockEntity->GetBlockType(); BLOCKTYPE WorldBlockType = m_ChunkData.GetBlock({BlockEntity->GetRelX(), BlockEntity->GetPosY(), BlockEntity->GetRelZ()}); if (EntityBlockType != WorldBlockType) @@ -142,7 +142,6 @@ void cSetChunkData::RemoveInvalidBlockEntities(void) ItemTypeToString(EntityBlockType), EntityBlockType, ItemTypeToString(WorldBlockType), WorldBlockType ); - delete BlockEntity; itr = m_BlockEntities.erase(itr); } else |