1
0

Changed cEntity::m_UniqueID to UInt32.

This commit is contained in:
Mattes D
2015-03-21 15:18:17 +01:00
parent b1d4b3bb96
commit cc069ccb2a
22 changed files with 223 additions and 168 deletions

View File

@@ -18,49 +18,50 @@
int cEntity::m_EntityCount = 0;
UInt32 cEntity::m_EntityCount = 0;
cCriticalSection cEntity::m_CSCount;
cEntity::cEntity(eEntityType a_EntityType, double a_X, double a_Y, double a_Z, double a_Width, double a_Height)
: m_UniqueID(0)
, m_Health(1)
, m_MaxHealth(1)
, m_AttachedTo(nullptr)
, m_Attachee(nullptr)
, m_bDirtyHead(true)
, m_bDirtyOrientation(true)
, m_bHasSentNoSpeed(true)
, m_bOnGround(false)
, m_Gravity(-9.81f)
, m_LastPos(a_X, a_Y, a_Z)
, m_IsInitialized(false)
, m_WorldTravellingFrom(nullptr)
, m_EntityType(a_EntityType)
, m_World(nullptr)
, m_IsFireproof(false)
, m_TicksSinceLastBurnDamage(0)
, m_TicksSinceLastLavaDamage(0)
, m_TicksSinceLastFireDamage(0)
, m_TicksLeftBurning(0)
, m_TicksSinceLastVoidDamage(0)
, m_IsSwimming(false)
, m_IsSubmerged(false)
, m_AirLevel(0)
, m_AirTickTimer(0)
, m_TicksAlive(0)
, m_HeadYaw(0.0)
, m_Rot(0.0, 0.0, 0.0)
, m_Pos(a_X, a_Y, a_Z)
, m_WaterSpeed(0, 0, 0)
, m_Mass (0.001) // Default 1g
, m_Width(a_Width)
, m_Height(a_Height)
, m_InvulnerableTicks(0)
cEntity::cEntity(eEntityType a_EntityType, double a_X, double a_Y, double a_Z, double a_Width, double a_Height):
m_UniqueID(INVALID_ID), // Proper ID will be assigned later in the constructor code
m_Health(1),
m_MaxHealth(1),
m_AttachedTo(nullptr),
m_Attachee(nullptr),
m_bDirtyHead(true),
m_bDirtyOrientation(true),
m_bHasSentNoSpeed(true),
m_bOnGround(false),
m_Gravity(-9.81f),
m_LastPos(a_X, a_Y, a_Z),
m_IsInitialized(false),
m_WorldTravellingFrom(nullptr),
m_EntityType(a_EntityType),
m_World(nullptr),
m_IsFireproof(false),
m_TicksSinceLastBurnDamage(0),
m_TicksSinceLastLavaDamage(0),
m_TicksSinceLastFireDamage(0),
m_TicksLeftBurning(0),
m_TicksSinceLastVoidDamage(0),
m_IsSwimming(false),
m_IsSubmerged(false),
m_AirLevel(0),
m_AirTickTimer(0),
m_TicksAlive(0),
m_HeadYaw(0.0),
m_Rot(0.0, 0.0, 0.0),
m_Pos(a_X, a_Y, a_Z),
m_WaterSpeed(0, 0, 0),
m_Mass (0.001), // Default 1g
m_Width(a_Width),
m_Height(a_Height),
m_InvulnerableTicks(0)
{
// Assign a proper ID:
cCSLock Lock(m_CSCount);
m_EntityCount++;
m_UniqueID = m_EntityCount;