summaryrefslogtreecommitdiffstats
path: root/src/Entities/Entity.cpp
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2015-03-21 15:18:17 +0100
committerMattes D <github@xoft.cz>2015-03-21 15:18:17 +0100
commitcc069ccb2a03db87e9de45ee84df9e2bd0b50545 (patch)
treee25723d95c7724505f7756a0dbbb0d48f68c7ddf /src/Entities/Entity.cpp
parentUnified cByteBuffer types. (diff)
downloadcuberite-cc069ccb2a03db87e9de45ee84df9e2bd0b50545.tar
cuberite-cc069ccb2a03db87e9de45ee84df9e2bd0b50545.tar.gz
cuberite-cc069ccb2a03db87e9de45ee84df9e2bd0b50545.tar.bz2
cuberite-cc069ccb2a03db87e9de45ee84df9e2bd0b50545.tar.lz
cuberite-cc069ccb2a03db87e9de45ee84df9e2bd0b50545.tar.xz
cuberite-cc069ccb2a03db87e9de45ee84df9e2bd0b50545.tar.zst
cuberite-cc069ccb2a03db87e9de45ee84df9e2bd0b50545.zip
Diffstat (limited to '')
-rw-r--r--src/Entities/Entity.cpp75
1 files changed, 38 insertions, 37 deletions
diff --git a/src/Entities/Entity.cpp b/src/Entities/Entity.cpp
index 1bc4690e1..329537c92 100644
--- a/src/Entities/Entity.cpp
+++ b/src/Entities/Entity.cpp
@@ -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;