summaryrefslogtreecommitdiffstats
path: root/src/Entities/Entity.cpp
diff options
context:
space:
mode:
authorHowaner <franzi.moos@googlemail.com>2014-07-17 22:32:23 +0200
committerHowaner <franzi.moos@googlemail.com>2014-07-17 22:32:23 +0200
commit52d4c49d5cd2c15078c84a18821761b723833584 (patch)
tree6c0eebd51cdcbc7a9ba71ad3341e300622d21dc8 /src/Entities/Entity.cpp
parentFixed mob knockback (diff)
downloadcuberite-52d4c49d5cd2c15078c84a18821761b723833584.tar
cuberite-52d4c49d5cd2c15078c84a18821761b723833584.tar.gz
cuberite-52d4c49d5cd2c15078c84a18821761b723833584.tar.bz2
cuberite-52d4c49d5cd2c15078c84a18821761b723833584.tar.lz
cuberite-52d4c49d5cd2c15078c84a18821761b723833584.tar.xz
cuberite-52d4c49d5cd2c15078c84a18821761b723833584.tar.zst
cuberite-52d4c49d5cd2c15078c84a18821761b723833584.zip
Diffstat (limited to 'src/Entities/Entity.cpp')
-rw-r--r--src/Entities/Entity.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/Entities/Entity.cpp b/src/Entities/Entity.cpp
index 4a6de25b7..3433258fd 100644
--- a/src/Entities/Entity.cpp
+++ b/src/Entities/Entity.cpp
@@ -1146,10 +1146,7 @@ void cEntity::SetMaxHealth(int a_MaxHealth)
m_MaxHealth = a_MaxHealth;
// Reset health, if too high:
- if (m_Health > a_MaxHealth)
- {
- m_Health = a_MaxHealth;
- }
+ m_Health = std::min(m_Health, a_MaxHealth);
}