aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJacob Lifshay <programmerjake@gmail.com>2019-09-28 19:30:58 -0700
committersfan5 <sfan5@live.de>2019-10-05 15:45:05 +0200
commit76032159bd4995c5d64a1f5cda7c63aab45e5cca (patch)
tree25fb457d2a8bf26f764f8121c6ba4cf85fb2bc48 /src
parent81c2370c8b1a66a279a5ff450c78caf5dfef77bf (diff)
downloadminetest-76032159bd4995c5d64a1f5cda7c63aab45e5cca.tar.gz
minetest-76032159bd4995c5d64a1f5cda7c63aab45e5cca.tar.bz2
minetest-76032159bd4995c5d64a1f5cda7c63aab45e5cca.zip
Fix unwanted detaching when damage = 0
Diffstat (limited to 'src')
-rw-r--r--src/client/content_cao.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/client/content_cao.cpp b/src/client/content_cao.cpp
index 716468402..934f4354e 100644
--- a/src/client/content_cao.cpp
+++ b/src/client/content_cao.cpp
@@ -1555,7 +1555,7 @@ void GenericCAO::processMessage(const std::string &data)
if (damage > 0)
{
- if (m_hp <= 0)
+ if (m_hp == 0)
{
// TODO: Execute defined fast response
// As there is no definition, make a smoke puff
@@ -1571,7 +1571,9 @@ void GenericCAO::processMessage(const std::string &data)
m_reset_textures_timer += 0.05 * damage;
updateTextures(m_current_texture_modifier + "^[brighten");
}
- } else {
+ }
+
+ if (m_hp == 0) {
// Same as 'Server::DiePlayer'
clearParentAttachment();
// Same as 'ObjectRef::l_remove'