diff options
Diffstat (limited to 'src/network')
-rw-r--r-- | src/network/serverpackethandler.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/network/serverpackethandler.cpp b/src/network/serverpackethandler.cpp index 0169a57da..8c2ba823c 100644 --- a/src/network/serverpackethandler.cpp +++ b/src/network/serverpackethandler.cpp @@ -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) { |