mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-13 00:25:19 +02:00
Run on_item_use CSM callback even if item is not marked usable
Mods may want to to handle item interaction even if the item is not marked usable (= server-side callback exists).
This commit is contained in:
@@ -3061,6 +3061,9 @@ void Game::processPlayerInteraction(f32 dtime, bool show_hud, bool show_debug)
|
||||
} else if (input->getLeftState()) {
|
||||
// When button is held down in air, show continuous animation
|
||||
runData.left_punch = true;
|
||||
// Run callback even though item is not usable
|
||||
if (input->getLeftClicked() && client->modsLoaded())
|
||||
client->getScript()->on_item_use(selected_item, pointed);
|
||||
} else if (input->getRightClicked()) {
|
||||
handlePointingAtNothing(selected_item);
|
||||
}
|
||||
|
Reference in New Issue
Block a user