From afaf104b4086dbc5245f92a209cb68a088780ebb Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Fri, 21 Dec 2012 12:52:14 +0000 Subject: Added more constants into eEntityType; made them a compulsory parameter to the constructor, so that all entities have proper type. Also added a few utility functions to cEntity for distinguishing the types (IsPlayer(), IsPickup() etc.) git-svn-id: http://mc-server.googlecode.com/svn/trunk@1092 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/Entity.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source/Entity.cpp') diff --git a/source/Entity.cpp b/source/Entity.cpp index a2e0c4a27..381a62e42 100644 --- a/source/Entity.cpp +++ b/source/Entity.cpp @@ -22,7 +22,7 @@ cCriticalSection cEntity::m_CSCount; -cEntity::cEntity(double a_X, double a_Y, double a_Z) +cEntity::cEntity(eEntityType a_EntityType, double a_X, double a_Y, double a_Z) : m_UniqueID( 0 ) , m_Referencers( new cReferenceManager( cReferenceManager::RFMNGR_REFERENCERS ) ) , m_References( new cReferenceManager( cReferenceManager::RFMNGR_REFERENCES ) ) @@ -33,8 +33,8 @@ cEntity::cEntity(double a_X, double a_Y, double a_Z) , m_bDirtyPosition( true ) , m_bDirtyOrientation( true ) , m_bDestroyed( false ) - , m_EntityType( eEntityType_Entity ) - , m_World( 0 ) + , m_EntityType(a_EntityType) + , m_World(NULL) , m_bRemovedFromChunk( false ) , m_FireDamageInterval(0.f) , m_BurnPeriod(0.f) -- cgit v1.2.3