Fix infinite grapple hook uses
This commit is contained in:
parent
d7f6dc7c06
commit
c698e3265b
1 changed files with 5 additions and 0 deletions
|
@ -23,7 +23,12 @@ local function throw_hook(itemstack, user, vel)
|
||||||
local yaw = user:get_look_horizontal()
|
local yaw = user:get_look_horizontal()
|
||||||
if pos and dir and yaw then
|
if pos and dir and yaw then
|
||||||
if not minetest.setting_getbool("creative_mode") then
|
if not minetest.setting_getbool("creative_mode") then
|
||||||
|
local before = itemstack:get_wear()
|
||||||
itemstack:add_wear(65535 / 100)
|
itemstack:add_wear(65535 / 100)
|
||||||
|
|
||||||
|
if itemstack:get_wear() < before then
|
||||||
|
itemstack:set_wear(65535)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
pos.y = pos.y + 1.5
|
pos.y = pos.y + 1.5
|
||||||
local obj = minetest.add_entity(pos, "shooter_hook:hook")
|
local obj = minetest.add_entity(pos, "shooter_hook:hook")
|
||||||
|
|
Loading…
Reference in a new issue