From: Jacob Lifshay Date: Sun, 29 Sep 2019 02:30:58 +0000 (-0700) Subject: Fix unwanted detaching when damage = 0 X-Git-Tag: 5.1.0~11 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=76032159bd4995c5d64a1f5cda7c63aab45e5cca;p=oweals%2Fminetest.git Fix unwanted detaching when damage = 0 --- 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'