1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-27 13:55:19 +01:00

Check if object is gone before calling on_rightclick

fix #16601
This commit is contained in:
Lars Müller
2025-10-25 17:37:12 +02:00
committed by GitHub
parent ff15b413b0
commit 377cdfb601

View File

@@ -1198,6 +1198,10 @@ void Server::handleCommand_Interact(NetworkPacket *pkt)
SendInventory(player, true);
}
// on_secondary_use might have removed the object
if (pointed_object->isGone())
return;
pointed_object->rightClick(playersao);
} else if (m_script->item_OnPlace(selected_item, playersao, pointed)) {
// Placement was handled in lua