diff options
Diffstat (limited to 'source/Entity.cpp')
-rw-r--r-- | source/Entity.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/source/Entity.cpp b/source/Entity.cpp index d9855afb0..80fe0d266 100644 --- a/source/Entity.cpp +++ b/source/Entity.cpp @@ -431,6 +431,15 @@ void cEntity::Heal(int a_HitPoints) +void cEntity::SetHealth(int a_Health) +{ + m_Health = std::max(0, std::min(m_MaxHealth, a_Health)); +} + + + + + void cEntity::Tick(float a_Dt, cChunk & a_Chunk) { if (m_AttachedTo != NULL) |