Skip to content

Commit

Permalink
Fix infinite grapple hook uses
Browse files Browse the repository at this point in the history
  • Loading branch information
LoneWolfHT committed Jul 10, 2020
1 parent d7f6dc7 commit c698e32
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions shooter_hook/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,12 @@ local function throw_hook(itemstack, user, vel)
local yaw = user:get_look_horizontal()
if pos and dir and yaw then
if not minetest.setting_getbool("creative_mode") then
local before = itemstack:get_wear()
itemstack:add_wear(65535 / 100)

if itemstack:get_wear() < before then
itemstack:set_wear(65535)
end
end
pos.y = pos.y + 1.5
local obj = minetest.add_entity(pos, "shooter_hook:hook")
Expand Down

0 comments on commit c698e32

Please sign in to comment.