mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Punchwear (improved) (#8959)
This commit is contained in:
parent
fec30e37ac
commit
70f9e1aafa
10 changed files with 73 additions and 31 deletions
|
@ -1163,9 +1163,13 @@ void Server::handleCommand_Interact(NetworkPacket *pkt)
|
|||
u16 src_original_hp = pointed_object->getHP();
|
||||
u16 dst_origin_hp = playersao->getHP();
|
||||
|
||||
pointed_object->punch(dir, &toolcap, playersao,
|
||||
u16 wear = pointed_object->punch(dir, &toolcap, playersao,
|
||||
time_from_last_punch);
|
||||
|
||||
bool changed = punchitem.addWear(wear, m_itemdef);
|
||||
if (changed)
|
||||
playersao->setWieldedItem(punchitem);
|
||||
|
||||
// If the object is a player and its HP changed
|
||||
if (src_original_hp != pointed_object->getHP() &&
|
||||
pointed_object->getType() == ACTIVEOBJECT_TYPE_PLAYER) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue