diff options
author | savilli <78875209+savilli@users.noreply.github.com> | 2021-08-28 12:14:16 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-28 12:14:16 +0200 |
commit | 3f1adb49ae8da5bb02bea52609524d3645b6a665 (patch) | |
tree | 43bebf8149ef9f83a1d3c79579e7ba6453e414ab /src/network | |
parent | 1d69a23ba48d99b051dcf2a6be225edd7c644c7b (diff) | |
download | minetest-3f1adb49ae8da5bb02bea52609524d3645b6a665.tar.gz minetest-3f1adb49ae8da5bb02bea52609524d3645b6a665.tar.bz2 minetest-3f1adb49ae8da5bb02bea52609524d3645b6a665.zip |
Remove redundant on_dieplayer calls
Diffstat (limited to 'src/network')
-rw-r--r-- | src/network/serverpackethandler.cpp | 16 |
1 files changed, 0 insertions, 16 deletions
diff --git a/src/network/serverpackethandler.cpp b/src/network/serverpackethandler.cpp index dc5864be3..77fde2a66 100644 --- a/src/network/serverpackethandler.cpp +++ b/src/network/serverpackethandler.cpp @@ -828,7 +828,6 @@ void Server::handleCommand_Damage(NetworkPacket* pkt) PlayerHPChangeReason reason(PlayerHPChangeReason::FALL); playersao->setHP((s32)playersao->getHP() - (s32)damage, reason); - SendPlayerHPOrDie(playersao, reason); } } @@ -1113,9 +1112,6 @@ void Server::handleCommand_Interact(NetworkPacket *pkt) float time_from_last_punch = playersao->resetTimeFromLastPunch(); - u16 src_original_hp = pointed_object->getHP(); - u16 dst_origin_hp = playersao->getHP(); - u16 wear = pointed_object->punch(dir, &toolcap, playersao, time_from_last_punch); @@ -1125,18 +1121,6 @@ void Server::handleCommand_Interact(NetworkPacket *pkt) if (changed) playersao->setWieldedItem(selected_item); - // 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, - PlayerHPChangeReason(PlayerHPChangeReason::PLAYER_PUNCH, playersao)); - } - - // If the puncher is a player and its HP changed - if (dst_origin_hp != playersao->getHP()) - SendPlayerHPOrDie(playersao, - PlayerHPChangeReason(PlayerHPChangeReason::PLAYER_PUNCH, pointed_object)); - return; } // action == INTERACT_START_DIGGING |