diff options
Diffstat (limited to '')
-rw-r--r-- | src/Entities/Entity.cpp | 10 | ||||
-rw-r--r-- | src/Entities/Entity.h | 2 |
2 files changed, 12 insertions, 0 deletions
diff --git a/src/Entities/Entity.cpp b/src/Entities/Entity.cpp index 5f6b81497..9ac8d2e3c 100644 --- a/src/Entities/Entity.cpp +++ b/src/Entities/Entity.cpp @@ -406,6 +406,16 @@ void cEntity::SetPitchFromSpeed(void) +const Vector3i cEntity::GetHeadPosition(void) +{ + int HeadHeight = CeilC(GetPosY() + GetHeight()) - 1; + return Vector3i(POSX_TOINT, HeadHeight, POSZ_TOINT); +} + + + + + bool cEntity::DoTakeDamage(TakeDamageInfo & a_TDI) { if (m_Health <= 0) diff --git a/src/Entities/Entity.h b/src/Entities/Entity.h index f39039183..3a4898757 100644 --- a/src/Entities/Entity.h +++ b/src/Entities/Entity.h @@ -303,6 +303,8 @@ public: /** Exported in ManualBindings */ const Vector3d & GetPosition(void) const { return m_Position; } + const Vector3i GetHeadPosition(void); + /** Exported in ManualBindings */ const Vector3d & GetSpeed(void) const { return m_Speed; } |