1
0
Fork 0
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:
sfan5 2020-03-04 19:13:26 +01:00
parent 8d6a0b917c
commit e774d8ca2f
3 changed files with 6 additions and 2 deletions

View file

@ -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);