diff options
author | Alexander Harkness <me@bearbin.net> | 2018-01-14 19:44:45 +0100 |
---|---|---|
committer | peterbell10 <peterbell10@live.co.uk> | 2018-01-14 19:44:45 +0100 |
commit | ad22922393c7982b885840960222de64ff96ad36 (patch) | |
tree | a028b7459f3c865f7e8bd563ae476c578763a9b1 /src/Entities/Entity.h | |
parent | Travis: Remove gdb (#4140) (diff) | |
download | cuberite-ad22922393c7982b885840960222de64ff96ad36.tar cuberite-ad22922393c7982b885840960222de64ff96ad36.tar.gz cuberite-ad22922393c7982b885840960222de64ff96ad36.tar.bz2 cuberite-ad22922393c7982b885840960222de64ff96ad36.tar.lz cuberite-ad22922393c7982b885840960222de64ff96ad36.tar.xz cuberite-ad22922393c7982b885840960222de64ff96ad36.tar.zst cuberite-ad22922393c7982b885840960222de64ff96ad36.zip |
Diffstat (limited to 'src/Entities/Entity.h')
-rw-r--r-- | src/Entities/Entity.h | 34 |
1 files changed, 23 insertions, 11 deletions
diff --git a/src/Entities/Entity.h b/src/Entities/Entity.h index fae296ab4..5b993ac96 100644 --- a/src/Entities/Entity.h +++ b/src/Entities/Entity.h @@ -481,11 +481,17 @@ public: virtual bool IsRclking (void) const {return false; } virtual bool IsInvisible(void) const { return false; } - /** Returns whether the player is swimming or not */ - virtual bool IsSwimming(void) const{ return m_IsSwimming; } + /** Returns true if any part of the entity is in a fire block */ + virtual bool IsInFire(void) const { return m_IsInFire; } - /** Return whether the player is under water or not */ - virtual bool IsSubmerged(void) const{ return m_IsSubmerged; } + /** Returns true if any part of the entity is in a lava block */ + virtual bool IsInLava(void) const { return m_IsInLava; } + + /** Returns true if any part of the entity is in a water block */ + virtual bool IsInWater(void) const { return m_IsInWater; } + + /** Returns true if any part of the entity is in a water block */ + virtual bool IsHeadInWater(void) const { return m_IsHeadInWater; } /** Gets remaining air of a monster */ int GetAirLevel(void) const { return m_AirLevel; } @@ -619,8 +625,17 @@ protected: /** Time, in ticks, since the last damage dealt by the void. Reset to zero when moving out of the void. */ int m_TicksSinceLastVoidDamage; - /** If an entity is currently swimming in or submerged under water */ - bool m_IsSwimming, m_IsSubmerged; + /** If any part of the entity is in a fire block */ + bool m_IsInFire; + + /** If any part of the entity is in a lava block */ + bool m_IsInLava; + + /** If any part of the entity is in a water block */ + bool m_IsInWater; + + /** If the entity's head is in a water block */ + bool m_IsHeadInWater; /** Air level of a mobile */ int m_AirLevel; @@ -647,7 +662,8 @@ protected: /** Called in each tick to handle air-related processing i.e. drowning */ virtual void HandleAir(void); - /** Called once per tick to set IsSwimming and IsSubmerged */ + /** Called once per tick to set m_IsInFire, m_IsInLava, m_IsInWater and + m_IsHeadInWater */ virtual void SetSwimState(cChunk & a_Chunk); private: @@ -693,7 +709,3 @@ private: cMonsterList m_LeashedMobs; } ; // tolua_export - - - - |