summaryrefslogtreecommitdiffstats
path: root/src/Entities
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2014-07-18 23:21:04 +0200
committermadmaxoft <github@xoft.cz>2014-07-18 23:21:04 +0200
commit44a4a83292f8d0f9011e76fce2e604587e1c3711 (patch)
treee5fb8b4386162f5265406f8eb35b4100002a2568 /src/Entities
parentMerge branch 'Sign' (diff)
parentFixed slime-related comments. (diff)
downloadcuberite-44a4a83292f8d0f9011e76fce2e604587e1c3711.tar
cuberite-44a4a83292f8d0f9011e76fce2e604587e1c3711.tar.gz
cuberite-44a4a83292f8d0f9011e76fce2e604587e1c3711.tar.bz2
cuberite-44a4a83292f8d0f9011e76fce2e604587e1c3711.tar.lz
cuberite-44a4a83292f8d0f9011e76fce2e604587e1c3711.tar.xz
cuberite-44a4a83292f8d0f9011e76fce2e604587e1c3711.tar.zst
cuberite-44a4a83292f8d0f9011e76fce2e604587e1c3711.zip
Diffstat (limited to 'src/Entities')
-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 28817428f..61b28ec70 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);
}