mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-18 10:45:27 +02:00
Call on_secondary_use when object is right-clicked
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user