diff options
author | LogicParrot <LogicParrot@users.noreply.github.com> | 2017-09-02 13:47:56 +0200 |
---|---|---|
committer | LogicParrot <LogicParrot@users.noreply.github.com> | 2017-09-02 13:47:56 +0200 |
commit | 0710995922546a904d5d018d2d5505017e24c0fc (patch) | |
tree | 101db7e8a701edfe965d9ee8a25cb9a3191cdcda /src/Entities | |
parent | Lambda revert fix (diff) | |
download | cuberite-0710995922546a904d5d018d2d5505017e24c0fc.tar cuberite-0710995922546a904d5d018d2d5505017e24c0fc.tar.gz cuberite-0710995922546a904d5d018d2d5505017e24c0fc.tar.bz2 cuberite-0710995922546a904d5d018d2d5505017e24c0fc.tar.lz cuberite-0710995922546a904d5d018d2d5505017e24c0fc.tar.xz cuberite-0710995922546a904d5d018d2d5505017e24c0fc.tar.zst cuberite-0710995922546a904d5d018d2d5505017e24c0fc.zip |
Diffstat (limited to 'src/Entities')
-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; } |