summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
authorfaketruth <faketruth@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-02-22 21:33:33 +0100
committerfaketruth <faketruth@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-02-22 21:33:33 +0100
commit3ca9b52ab28c5ffd4fe2a6e1789ca5320449b7c3 (patch)
treefea725ce4760f54eda46509eb32a90229f66d7b2 /source
parentFixed a bug that no chunks were unloaded on the client. Now chunks are properly unloaded on the clients. (diff)
downloadcuberite-3ca9b52ab28c5ffd4fe2a6e1789ca5320449b7c3.tar
cuberite-3ca9b52ab28c5ffd4fe2a6e1789ca5320449b7c3.tar.gz
cuberite-3ca9b52ab28c5ffd4fe2a6e1789ca5320449b7c3.tar.bz2
cuberite-3ca9b52ab28c5ffd4fe2a6e1789ca5320449b7c3.tar.lz
cuberite-3ca9b52ab28c5ffd4fe2a6e1789ca5320449b7c3.tar.xz
cuberite-3ca9b52ab28c5ffd4fe2a6e1789ca5320449b7c3.tar.zst
cuberite-3ca9b52ab28c5ffd4fe2a6e1789ca5320449b7c3.zip
Diffstat (limited to '')
-rw-r--r--source/cChunk.cpp6
-rw-r--r--source/cEntity.cpp2
2 files changed, 6 insertions, 2 deletions
diff --git a/source/cChunk.cpp b/source/cChunk.cpp
index c8ba8ba4c..a011bde51 100644
--- a/source/cChunk.cpp
+++ b/source/cChunk.cpp
@@ -247,7 +247,11 @@ void cChunk::SetAllData(const char * a_BlockData, cEntityList & a_Entities, cBlo
(*itr)->GetUniqueID(), (*itr)->GetClass(),
m_PosX, m_PosZ
);
- delete *itr;
+
+ // Assert because this is a very curious case. These lines were executed once before, when a player died, re spawned, and walked around a bit. It's uncertain why an entity would be in the chunk in this case.
+ ASSERT(!"Unexpected entity in chunk!");
+
+ (*itr)->Destroy();
}
}
for (cBlockEntityList::iterator itr = m_BlockEntities.begin(); itr != m_BlockEntities.end(); ++itr)
diff --git a/source/cEntity.cpp b/source/cEntity.cpp
index 49993c093..9f70adc10 100644
--- a/source/cEntity.cpp
+++ b/source/cEntity.cpp
@@ -60,7 +60,7 @@ cEntity::~cEntity()
if( !m_bDestroyed || !m_bRemovedFromChunk )
{
- LOGERROR("ERROR: Entity deallocated without being destroyed %i or unlinked %i", m_bDestroyed, m_bRemovedFromChunk );
+ ASSERT(!"Entity deallocated without being destroyed %i or unlinked %i", m_bDestroyed, m_bRemovedFromChunk );
}
delete m_Referencers;
delete m_References;