diff options
author | sfan5 <sfan5@live.de> | 2019-11-10 00:36:29 +0100 |
---|---|---|
committer | sfan5 <sfan5@live.de> | 2019-11-10 13:12:31 +0100 |
commit | 4d668f32a6d9a0d895a2385dec994d43bd084410 (patch) | |
tree | 83794c0ae69813f73df258072ab53aae1b7a1dd6 /src/network | |
parent | 3b0df9760b9630ddba1983ecb4c6e4f0f8857149 (diff) | |
download | minetest-4d668f32a6d9a0d895a2385dec994d43bd084410.tar.gz minetest-4d668f32a6d9a0d895a2385dec994d43bd084410.tar.bz2 minetest-4d668f32a6d9a0d895a2385dec994d43bd084410.zip |
Call on_secondary_use when object is right-clicked
Diffstat (limited to 'src/network')
-rw-r--r-- | src/network/serverpackethandler.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/network/serverpackethandler.cpp b/src/network/serverpackethandler.cpp index d8fbeebd5..7a42ce5ef 100644 --- a/src/network/serverpackethandler.cpp +++ b/src/network/serverpackethandler.cpp @@ -1316,6 +1316,13 @@ void Server::handleCommand_Interact(NetworkPacket *pkt) << pointed_object->getDescription() << std::endl; // Do stuff + if (m_script->item_OnSecondaryUse( + selected_item, playersao, pointed)) { + if (playersao->setWieldedItem(selected_item)) { + SendInventory(playersao, true); + } + } + pointed_object->rightClick(playersao); } else if (m_script->item_OnPlace( selected_item, playersao, pointed)) { @@ -1376,8 +1383,10 @@ void Server::handleCommand_Interact(NetworkPacket *pkt) actionstream << player->getName() << " activates " << selected_item.name << std::endl; + pointed.type = POINTEDTHING_NOTHING; // can only ever be NOTHING + if (m_script->item_OnSecondaryUse( - selected_item, playersao)) { + selected_item, playersao, pointed)) { if (playersao->setWieldedItem(selected_item)) { SendInventory(playersao, true); } |