mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-11 17:51:04 +00:00
Fixes around ServerActiveObject on_punch handling
This commit is contained in:
parent
8d6a0b917c
commit
e774d8ca2f
3 changed files with 6 additions and 2 deletions
|
@ -1166,6 +1166,8 @@ void Server::handleCommand_Interact(NetworkPacket *pkt)
|
|||
u16 wear = pointed_object->punch(dir, &toolcap, playersao,
|
||||
time_from_last_punch);
|
||||
|
||||
// Callback may have changed item, so get it again
|
||||
playersao->getWieldedItem(&selected_item);
|
||||
bool changed = selected_item.addWear(wear, m_itemdef);
|
||||
if (changed)
|
||||
playersao->setWieldedItem(selected_item);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue