summaryrefslogtreecommitdiffstats
path: root/src/Entities/Entity.cpp
diff options
context:
space:
mode:
authorarchshift <admin@archshift.com>2014-07-19 10:40:29 +0200
committerarchshift <admin@archshift.com>2014-07-19 10:40:29 +0200
commit041bfd5860cd8ef51db42eb6fb4b50b45549feba (patch)
tree2d93a68b888a5e2b410ec95d124edaad6f67bb92 /src/Entities/Entity.cpp
parentRenamed AllToLua_lua script. (diff)
downloadcuberite-041bfd5860cd8ef51db42eb6fb4b50b45549feba.tar
cuberite-041bfd5860cd8ef51db42eb6fb4b50b45549feba.tar.gz
cuberite-041bfd5860cd8ef51db42eb6fb4b50b45549feba.tar.bz2
cuberite-041bfd5860cd8ef51db42eb6fb4b50b45549feba.tar.lz
cuberite-041bfd5860cd8ef51db42eb6fb4b50b45549feba.tar.xz
cuberite-041bfd5860cd8ef51db42eb6fb4b50b45549feba.tar.zst
cuberite-041bfd5860cd8ef51db42eb6fb4b50b45549feba.zip
Diffstat (limited to '')
-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 61b28ec70..f9331ede8 100644
--- a/src/Entities/Entity.cpp
+++ b/src/Entities/Entity.cpp
@@ -327,10 +327,7 @@ bool cEntity::DoTakeDamage(TakeDamageInfo & a_TDI)
// TODO: Apply damage to armor
- if (m_Health < 0)
- {
- m_Health = 0;
- }
+ m_Health = std::max(m_Health, 0);
if ((IsMob() || IsPlayer()) && (a_TDI.Attacker != NULL)) // Knockback for only players and mobs
{