diff options
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 - - - - |