1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-13 16:45:20 +02:00

[CSM] add on_item_use (#5544)

This commit is contained in:
red-001
2017-05-06 20:12:44 +01:00
committed by Loïc Blot
parent 6658ad3d94
commit 5ebf8f9450
6 changed files with 34 additions and 1 deletions

View File

@@ -3553,7 +3553,8 @@ void Game::processPlayerInteraction(f32 dtime, bool show_hud, bool show_debug)
runData.repeat_rightclick_timer = 0;
if (playeritem_def.usable && isLeftPressed()) {
if (getLeftClicked())
if (getLeftClicked() && (!client->moddingEnabled()
|| !client->getScript()->on_item_use(playeritem, pointed)))
client->interact(4, pointed);
} else if (pointed.type == POINTEDTHING_NODE) {
ToolCapabilities playeritem_toolcap =