1
0
Fork 0

Fix crash in mcl_fishing

This commit is contained in:
Wuzzy 2019-09-27 12:09:03 +02:00
parent 5ba4f1b899
commit d9d1e5c08c
1 changed files with 3 additions and 2 deletions

View File

@ -41,6 +41,7 @@ local fish = function(itemstack, player)
noent = false noent = false
if ent._dive == true then if ent._dive == true then
local itemname local itemname
local items
local itemcount = 1 local itemcount = 1
local itemwear = 0 local itemwear = 0
-- FIXME: Maybe use a better seeding -- FIXME: Maybe use a better seeding
@ -103,7 +104,7 @@ local fish = function(itemstack, player)
local idef = itemstack:get_definition() local idef = itemstack:get_definition()
itemstack:add_wear(65535/65) -- 65 uses itemstack:add_wear(65535/65) -- 65 uses
if itemstack:get_count() == 0 and idef.sound and idef.sound.breaks then if itemstack:get_count() == 0 and idef.sound and idef.sound.breaks then
minetest.sound_play(idef.sound.breaks, {pos=player.get_pos(), gain=0.5}) minetest.sound_play(idef.sound.breaks, {pos=player:get_pos(), gain=0.5})
end end
end end
end end
@ -117,7 +118,7 @@ local fish = function(itemstack, player)
local idef = itemstack:get_definition() local idef = itemstack:get_definition()
itemstack:add_wear((65535/65)*2) -- if so and not creative then wear double like in MC. itemstack:add_wear((65535/65)*2) -- if so and not creative then wear double like in MC.
if itemstack:get_count() == 0 and idef.sound and idef.sound.breaks then if itemstack:get_count() == 0 and idef.sound and idef.sound.breaks then
minetest.sound_play(idef.sound.breaks, {pos=player.get_pos(), gain=0.5}) minetest.sound_play(idef.sound.breaks, {pos=player:get_pos(), gain=0.5})
end end
end end
end end