diff options
author | Mattes D <github@xoft.cz> | 2015-03-21 15:18:17 +0100 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2015-03-21 15:18:17 +0100 |
commit | cc069ccb2a03db87e9de45ee84df9e2bd0b50545 (patch) | |
tree | e25723d95c7724505f7756a0dbbb0d48f68c7ddf /src/Entities/Entity.h | |
parent | Unified cByteBuffer types. (diff) | |
download | cuberite-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.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/Entities/Entity.h b/src/Entities/Entity.h index 809e974d2..9bb1837f1 100644 --- a/src/Entities/Entity.h +++ b/src/Entities/Entity.h @@ -142,6 +142,10 @@ public: static const int VOID_BOUNDARY = -46; ///< Y position to begin applying void damage static const int FALL_DAMAGE_HEIGHT = 4; ///< Y difference after which fall damage is applied + + /** Special ID that is considered an "invalid value", signifying no entity. */ + static const UInt32 INVALID_ID = 0; // Exported to Lua in ManualBindings.cpp, ToLua doesn't parse initialized constants. + cEntity(eEntityType a_EntityType, double a_X, double a_Y, double a_Z, double a_Width, double a_Height); virtual ~cEntity(); @@ -248,7 +252,7 @@ public: virtual void HandleSpeedFromAttachee(float a_Forward, float a_Sideways); void SteerVehicle(float a_Forward, float a_Sideways); - inline int GetUniqueID(void) const { return m_UniqueID; } + inline UInt32 GetUniqueID(void) const { return m_UniqueID; } inline bool IsDestroyed(void) const { return !m_IsInitialized; } /// Schedules the entity for destroying; if a_ShouldBroadcast is set to true, broadcasts the DestroyEntity packet @@ -464,12 +468,15 @@ public: protected: static cCriticalSection m_CSCount; - static int m_EntityCount; + static UInt32 m_EntityCount; /** Measured in meter/second (m/s) */ Vector3d m_Speed; - int m_UniqueID; + /** The ID of the entity that is guaranteed to be unique within a single run of the server. + Always nonzero (a zero UniqueID (cEntity::INVALID_ID) is used for error reporting). + Note that the UniqueID is not persisted through storage. */ + UInt32 m_UniqueID; int m_Health; int m_MaxHealth; |