forked from mff/fishing
Remove various deprecated functions
This commit is contained in:
parent
f81a90c20a
commit
2a8650bc4b
@ -99,7 +99,7 @@ local FISHING_BOBBER_ENTITY={
|
|||||||
if inv:room_for_item("main", {name=name, count=1, wear=wear_value, metadata=""}) then
|
if inv:room_for_item("main", {name=name, count=1, wear=wear_value, metadata=""}) then
|
||||||
inv:add_item("main", {name=name, count=1, wear=wear_value, metadata=""})
|
inv:add_item("main", {name=name, count=1, wear=wear_value, metadata=""})
|
||||||
else
|
else
|
||||||
minetest.spawn_item(clicker:getpos(), {name=name, count=1, wear=wear_value, metadata=""})
|
minetest.spawn_item(clicker:get_pos(), {name=name, count=1, wear=wear_value, metadata=""})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
@ -151,14 +151,14 @@ local FISHING_BOBBER_ENTITY={
|
|||||||
local p = player:get_pos()
|
local p = player:get_pos()
|
||||||
local dist = ((p.x-pos.x)^2 + (p.y-pos.y)^2 + (p.z-pos.z)^2)^0.5
|
local dist = ((p.x-pos.x)^2 + (p.y-pos.y)^2 + (p.z-pos.z)^2)^0.5
|
||||||
if dist > fishing_setting.settings["bobber_view_range"] then
|
if dist > fishing_setting.settings["bobber_view_range"] then
|
||||||
minetest.sound_play("fishing_bobber1", {pos = self.object:getpos(),gain = 0.5,})
|
minetest.sound_play("fishing_bobber1", {pos = self.object:get_pos(),gain = 0.5,})
|
||||||
self.object:remove()
|
self.object:remove()
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
--rotate bobber
|
--rotate bobber
|
||||||
if math.random(1, 4) == 1 then
|
if math.random(1, 4) == 1 then
|
||||||
self.object:set_yaw(self.object:getyaw()+((math.random(0,360)-180)/2880*math.pi))
|
self.object:set_yaw(self.object:get_yaw()+((math.random(0,360)-180)/2880*math.pi))
|
||||||
end
|
end
|
||||||
|
|
||||||
self.timer = self.timer + 1
|
self.timer = self.timer + 1
|
||||||
|
@ -125,7 +125,7 @@ local FISHING_BOBBER_SHARK_ENTITY={
|
|||||||
0.25, 0.40, -- min size, max size
|
0.25, 0.40, -- min size, max size
|
||||||
false, "fishing_particle_baitball_shark.png")
|
false, "fishing_particle_baitball_shark.png")
|
||||||
-- add sound
|
-- add sound
|
||||||
minetest.sound_play("fishing_baitball", {pos = self.object:getpos(), gain = 0.2, })
|
minetest.sound_play("fishing_baitball", {pos = self.object:get_pos(), gain = 0.2, })
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
|
|
||||||
@ -156,7 +156,7 @@ local FISHING_BOBBER_SHARK_ENTITY={
|
|||||||
|
|
||||||
--rotate bobber
|
--rotate bobber
|
||||||
if math.random(1, 4) == 1 then
|
if math.random(1, 4) == 1 then
|
||||||
self.object:setyaw(self.object:get_yaw()+((math.random(0,360)-180)/2880*math.pi))
|
self.object:set_yaw(self.object:get_yaw()+((math.random(0,360)-180)/2880*math.pi))
|
||||||
end
|
end
|
||||||
|
|
||||||
self.timer = self.timer + 1
|
self.timer = self.timer + 1
|
||||||
|
Loading…
Reference in New Issue
Block a user