From 0710995922546a904d5d018d2d5505017e24c0fc Mon Sep 17 00:00:00 2001 From: LogicParrot Date: Sat, 2 Sep 2017 14:47:56 +0300 Subject: Reimplemented skeletons using Behaviors --- src/Entities/Entity.cpp | 10 ++++++++++ src/Entities/Entity.h | 2 ++ 2 files changed, 12 insertions(+) (limited to 'src/Entities') 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; } -- cgit v1.2.3