1
0
mirror of https://github.com/luanti-org/luanti.git synced 2026-01-14 13:25:21 +01:00

Clarify that punch toolcaps are not optional (#16720)

This commit is contained in:
sfan5
2025-12-28 15:30:25 +01:00
committed by GitHub
parent f18d122a8e
commit 1dbb3eae32
17 changed files with 69 additions and 85 deletions

View File

@@ -1046,7 +1046,7 @@ void Server::handleCommand_Interact(NetworkPacket *pkt)
ItemStack selected_item, hand_item;
ItemStack tool_item = playersao->getWieldedItem(&selected_item, &hand_item);
ToolCapabilities toolcap =
const ToolCapabilities &toolcap =
tool_item.getToolCapabilities(m_itemdef, &hand_item);
v3f dir = (pointed_object->getBasePosition() -
(playersao->getBasePosition() + playersao->getEyeOffset())
@@ -1054,7 +1054,7 @@ void Server::handleCommand_Interact(NetworkPacket *pkt)
float time_from_last_punch =
playersao->resetTimeFromLastPunch();
u32 wear = pointed_object->punch(dir, &toolcap, playersao,
u32 wear = pointed_object->punch(dir, toolcap, playersao,
time_from_last_punch, tool_item.wear);
// Callback may have changed item, so get it again