mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-23 11:01:06 +01:00
Remove some dangerous minetest.after in mcl_boats
This commit is contained in:
parent
f4e59be53f
commit
1a6a9ecf0f
1 changed files with 2 additions and 7 deletions
|
@ -67,9 +67,7 @@ function boat.on_rightclick(self, clicker)
|
||||||
mcl_player.player_set_animation(clicker, "stand" , 30)
|
mcl_player.player_set_animation(clicker, "stand" , 30)
|
||||||
local pos = clicker:getpos()
|
local pos = clicker:getpos()
|
||||||
pos = {x = pos.x, y = pos.y + 0.2, z = pos.z}
|
pos = {x = pos.x, y = pos.y + 0.2, z = pos.z}
|
||||||
minetest.after(0.1, function()
|
clicker:setpos(pos)
|
||||||
clicker:setpos(pos)
|
|
||||||
end)
|
|
||||||
elseif not self.driver then
|
elseif not self.driver then
|
||||||
local attach = clicker:get_attach()
|
local attach = clicker:get_attach()
|
||||||
if attach and attach:get_luaentity() then
|
if attach and attach:get_luaentity() then
|
||||||
|
@ -127,10 +125,7 @@ function boat.on_punch(self, puncher)
|
||||||
if not minetest.setting_getbool("creative_mode") then
|
if not minetest.setting_getbool("creative_mode") then
|
||||||
minetest.add_item(self.object:getpos(), leftover)
|
minetest.add_item(self.object:getpos(), leftover)
|
||||||
end
|
end
|
||||||
-- delay remove to ensure player is detached
|
self.object:remove()
|
||||||
minetest.after(0.1, function()
|
|
||||||
self.object:remove()
|
|
||||||
end)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue