From 063707c0b677322edf57163024e4c6370ceb8de3 Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Tue, 17 Mar 2020 00:39:41 +0000 Subject: [PATCH] Fix inability to pick up hook with unloaded grapple gun Fixes #568 --- mods/pvp/shooter_tweaks/init.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mods/pvp/shooter_tweaks/init.lua b/mods/pvp/shooter_tweaks/init.lua index 06af634..22f680e 100644 --- a/mods/pvp/shooter_tweaks/init.lua +++ b/mods/pvp/shooter_tweaks/init.lua @@ -23,7 +23,12 @@ wrap_callback("shooter_hook:grapple_gun_loaded", "on_use", function(old, itemsta return old(itemstack, ...) end) -wrap_callback("shooter_hook:grapple_gun", "on_use", function(old, itemstack, user) +wrap_callback("shooter_hook:grapple_gun", "on_use", function(old, itemstack, user, pointed_thing) + if pointed_thing.type == "object" then + pointed_thing.ref:punch(user, 1.0, { full_punch_interval=1.0 }, nil) + return user:get_wielded_item() + end + local inv = user:get_inventory() if inv:contains_item("main", "shooter_hook:grapple_hook") then minetest.sound_play("shooter_reload", {object=user})