1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-09-30 19:22:14 +00:00

Add new hotbar_slot_selected lua callback

This commit is contained in:
Zenon Seth 2025-05-13 14:31:13 +01:00
parent 1f9a3b5875
commit 7425126f6b
8 changed files with 169 additions and 2 deletions

View file

@ -734,6 +734,14 @@ void Server::handleCommand_InventoryAction(NetworkPacket* pkt)
if (!check_inv_access(ca->craft_inv))
return;
}
/*
Handle HotbarSlotSelected action special cases
*/
else if (a->getType() == IAction::HotbarSlotSelected) {
IHotbarSlotSelectedAction *ha = (IHotbarSlotSelectedAction*)a.get();
ha->inv.applyCurrentPlayer(player->getName());
// Note: `IHotbarSlotSelectedAction::clientApply` is empty, thus nothing to revert.
} else {
// Unknown action. Ignored.
return;