From 3f271564e08716cfeb4a966f4291524b0fac05d3 Mon Sep 17 00:00:00 2001 From: sfan5 Date: Sat, 9 Nov 2019 00:41:33 +0100 Subject: 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). --- src/client/game.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/client/game.cpp b/src/client/game.cpp index 450eb4e32..59654e892 100644 --- a/src/client/game.cpp +++ b/src/client/game.cpp @@ -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); } -- cgit v1.2.3