From 3ca9b52ab28c5ffd4fe2a6e1789ca5320449b7c3 Mon Sep 17 00:00:00 2001 From: faketruth Date: Wed, 22 Feb 2012 20:33:33 +0000 Subject: Added some asserts to trace a bug git-svn-id: http://mc-server.googlecode.com/svn/trunk@319 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/cChunk.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'source/cChunk.cpp') 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) -- cgit v1.2.3