aboutsummaryrefslogtreecommitdiff
path: root/src/network
diff options
context:
space:
mode:
authorkwolekr <kwolekr@minetest.net>2015-07-10 15:58:32 -0400
committerkwolekr <kwolekr@minetest.net>2015-07-10 15:58:57 -0400
commit1a1774a1051790ef85b1bd8b047ac45a3676b5d6 (patch)
treeb5e0083230d80960f43c7eed3ea5787e92976ae1 /src/network
parent8eb272cea38325f963c521ecfa7b927a563f8509 (diff)
downloadminetest-1a1774a1051790ef85b1bd8b047ac45a3676b5d6.tar.gz
minetest-1a1774a1051790ef85b1bd8b047ac45a3676b5d6.tar.bz2
minetest-1a1774a1051790ef85b1bd8b047ac45a3676b5d6.zip
Fix damage flash when damage disabled
Diffstat (limited to 'src/network')
-rw-r--r--src/network/serverpackethandler.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/network/serverpackethandler.cpp b/src/network/serverpackethandler.cpp
index 92dfe1020..5493dfec1 100644
--- a/src/network/serverpackethandler.cpp
+++ b/src/network/serverpackethandler.cpp
@@ -1151,7 +1151,7 @@ void Server::handleCommand_Damage(NetworkPacket* pkt)
<< std::endl;
playersao->setHP(playersao->getHP() - damage);
- SendPlayerHPOrDie(playersao->getPeerID(), playersao->getHP() == 0);
+ SendPlayerHPOrDie(playersao);
}
}
@@ -1510,14 +1510,12 @@ void Server::handleCommand_Interact(NetworkPacket* pkt)
// If the object is a player and its HP changed
if (src_original_hp != pointed_object->getHP() &&
pointed_object->getType() == ACTIVEOBJECT_TYPE_PLAYER) {
- SendPlayerHPOrDie(((PlayerSAO*)pointed_object)->getPeerID(),
- pointed_object->getHP() == 0);
+ SendPlayerHPOrDie((PlayerSAO *)pointed_object);
}
// If the puncher is a player and its HP changed
- if (dst_origin_hp != playersao->getHP()) {
- SendPlayerHPOrDie(playersao->getPeerID(), playersao->getHP() == 0);
- }
+ if (dst_origin_hp != playersao->getHP())
+ SendPlayerHPOrDie(playersao);
}
} // action == 0