From 905cc96dff382a6dfb996fcae07466b7b7f565ee Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Sun, 7 Apr 2013 21:04:23 +0000 Subject: Fixed an assert in entities when destroying an entity without ever initializing it git-svn-id: http://mc-server.googlecode.com/svn/trunk@1369 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/Entity.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'source/Entity.cpp') diff --git a/source/Entity.cpp b/source/Entity.cpp index c6df88020..d2404373b 100644 --- a/source/Entity.cpp +++ b/source/Entity.cpp @@ -36,7 +36,7 @@ cEntity::cEntity(eEntityType a_EntityType, double a_X, double a_Y, double a_Z) , m_bDirtyOrientation(true) , m_bDirtyPosition(true) , m_bDirtySpeed(true) - , m_bDestroyed(false) + , m_bDestroyed(true) , m_LastPosX( 0.0 ) , m_LastPosY( 0.0 ) , m_LastPosZ( 0.0 ) @@ -45,7 +45,7 @@ cEntity::cEntity(eEntityType a_EntityType, double a_X, double a_Y, double a_Z) , m_TimeLastSpeedPacket(0) , m_EntityType(a_EntityType) , m_World(NULL) - , m_bRemovedFromChunk(false) + , m_bRemovedFromChunk(true) , m_FireDamageInterval(0.f) , m_BurnPeriod(0.f) { @@ -118,6 +118,9 @@ const char * cEntity::GetParentClass(void) const void cEntity::Initialize(cWorld * a_World) { + m_bDestroyed = false; + m_bRemovedFromChunk = false; + m_World = a_World; m_World->AddEntity(this); -- cgit v1.2.3