mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Add on_secondary_use when right clicking an item in the air
This commit is contained in:
parent
57b429574e
commit
97908cc656
8 changed files with 71 additions and 0 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue