aboutsummaryrefslogtreecommitdiff
path: root/src/network/serverpackethandler.cpp
diff options
context:
space:
mode:
authorAlex Ford <gordion42@gmail.com>2015-11-18 12:26:09 -0700
committerparamat <mat.gregory@virginmedia.com>2015-12-02 02:18:44 +0000
commit97908cc65670d3f6cf2e286390bfea10f653aaa8 (patch)
tree49c1b4bb175990d7402590a78a9edd8bb804e6bc /src/network/serverpackethandler.cpp
parent57b429574ef92c62d202955535896b36845b88db (diff)
downloadminetest-97908cc65670d3f6cf2e286390bfea10f653aaa8.tar.gz
minetest-97908cc65670d3f6cf2e286390bfea10f653aaa8.tar.bz2
minetest-97908cc65670d3f6cf2e286390bfea10f653aaa8.zip
Add on_secondary_use when right clicking an item in the air
Diffstat (limited to 'src/network/serverpackethandler.cpp')
-rw-r--r--src/network/serverpackethandler.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/network/serverpackethandler.cpp b/src/network/serverpackethandler.cpp
index a4fa502ae..a5aaf1ecb 100644
--- a/src/network/serverpackethandler.cpp
+++ b/src/network/serverpackethandler.cpp
@@ -1653,6 +1653,23 @@ void Server::handleCommand_Interact(NetworkPacket* pkt)
}
} // action == 4
+
+ /*
+ 5: rightclick air
+ */
+ else if (action == 5) {
+ ItemStack item = playersao->getWieldedItem();
+
+ actionstream << player->getName() << " activates "
+ << item.name << std::endl;
+
+ if (m_script->item_OnSecondaryUse(
+ item, playersao)) {
+ if( playersao->setWieldedItem(item)) {
+ SendInventory(playersao);
+ }
+ }
+ }
/*