mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2025-01-10 09:09:43 +01:00
Update flying bobber detection to work with Projectile API changes
This commit is contained in:
parent
6824ce0428
commit
98f115eb31
1 changed files with 6 additions and 10 deletions
|
@ -173,17 +173,14 @@ local fish = function(itemstack, player, pointed_thing)
|
|||
end
|
||||
end
|
||||
--Check for flying bobber.
|
||||
local player_name = player:get_player_name()
|
||||
for n = 1, #objs do
|
||||
ent = objs[n]:get_luaentity()
|
||||
if ent then
|
||||
if ent._thrower and ent.objtype=="fishing" then
|
||||
if player:get_player_name() == ent._thrower then
|
||||
if ent and ent._owner == player_name and ent.objtype=="fishing" then
|
||||
noent = false
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
--If no bobber or flying_bobber exists then throw bobber.
|
||||
if noent == true then
|
||||
local playerpos = player:get_pos()
|
||||
|
@ -349,7 +346,6 @@ vl_projectile.register("mcl_fishing:flying_bobber_entity", {
|
|||
},
|
||||
|
||||
_lastpos={},
|
||||
_thrower = nil,
|
||||
objtype="fishing",
|
||||
})
|
||||
|
||||
|
@ -365,7 +361,7 @@ minetest.register_on_leaveplayer(function(player)
|
|||
if ent then
|
||||
if ent.player and ent.objtype=="fishing" then
|
||||
ent.object:remove()
|
||||
elseif ent._thrower and ent.objtype=="fishing" then
|
||||
elseif ent._owner and ent.objtype=="fishing" then
|
||||
ent.object:remove()
|
||||
end
|
||||
end
|
||||
|
@ -384,7 +380,7 @@ minetest.register_on_dieplayer(function(player)
|
|||
if ent then
|
||||
if ent.player and ent.objtype=="fishing" then
|
||||
ent.object:remove()
|
||||
elseif ent._thrower and ent.objtype=="fishing" then
|
||||
elseif ent._owner and ent.objtype=="fishing" then
|
||||
ent.object:remove()
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue