Skip to content

Commit 7603215

Browse files
programmerjakesfan5
authored andcommittedOct 5, 2019
Fix unwanted detaching when damage = 0
1 parent 81c2370 commit 7603215

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed
 

‎src/client/content_cao.cpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -1555,7 +1555,7 @@ void GenericCAO::processMessage(const std::string &data)
15551555

15561556
if (damage > 0)
15571557
{
1558-
if (m_hp <= 0)
1558+
if (m_hp == 0)
15591559
{
15601560
// TODO: Execute defined fast response
15611561
// As there is no definition, make a smoke puff
@@ -1571,7 +1571,9 @@ void GenericCAO::processMessage(const std::string &data)
15711571
m_reset_textures_timer += 0.05 * damage;
15721572
updateTextures(m_current_texture_modifier + "^[brighten");
15731573
}
1574-
} else {
1574+
}
1575+
1576+
if (m_hp == 0) {
15751577
// Same as 'Server::DiePlayer'
15761578
clearParentAttachment();
15771579
// Same as 'ObjectRef::l_remove'

0 commit comments

Comments
 (0)
Please sign in to comment.