diff options
author | Mattes D <github@xoft.cz> | 2015-03-24 13:09:41 +0100 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2015-03-24 13:09:41 +0100 |
commit | e5a7a730ed4f26eae896c56391bf3d2b5fecb852 (patch) | |
tree | 0209c1567f60af60999f3aeeb513a72f9eab2743 /src/Entities/Entity.cpp | |
parent | Merge pull request #1775 from tommysanterre/terrainheightfix (diff) | |
parent | Added VarInt64, normalized cPacketizer datatype names. (diff) | |
download | cuberite-e5a7a730ed4f26eae896c56391bf3d2b5fecb852.tar cuberite-e5a7a730ed4f26eae896c56391bf3d2b5fecb852.tar.gz cuberite-e5a7a730ed4f26eae896c56391bf3d2b5fecb852.tar.bz2 cuberite-e5a7a730ed4f26eae896c56391bf3d2b5fecb852.tar.lz cuberite-e5a7a730ed4f26eae896c56391bf3d2b5fecb852.tar.xz cuberite-e5a7a730ed4f26eae896c56391bf3d2b5fecb852.tar.zst cuberite-e5a7a730ed4f26eae896c56391bf3d2b5fecb852.zip |
Diffstat (limited to 'src/Entities/Entity.cpp')
-rw-r--r-- | src/Entities/Entity.cpp | 75 |
1 files changed, 38 insertions, 37 deletions
diff --git a/src/Entities/Entity.cpp b/src/Entities/Entity.cpp index 039c58ee4..c8df6b4b1 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; |