mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Remove redundant on_dieplayer calls
This commit is contained in:
parent
1d69a23ba4
commit
3f1adb49ae
5 changed files with 3 additions and 40 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue