mirror of
https://git.minetest.land/MineClone2/MineClone2.git
synced 2024-11-28 13:53:45 +01:00
Fix #949
This commit is contained in:
parent
269ebc2718
commit
507f2d872b
@ -59,6 +59,15 @@ local boat = {
|
|||||||
_animation = 0, -- 0: not animated; 1: paddling forwards; -1: paddling forwards
|
_animation = 0, -- 0: not animated; 1: paddling forwards; -1: paddling forwards
|
||||||
}
|
}
|
||||||
|
|
||||||
|
local function detach_player(player)
|
||||||
|
player:set_detach()
|
||||||
|
player:set_properties({visual_size = {x=1, y=1}})
|
||||||
|
mcl_player.player_attached[player:get_player_name()] = false
|
||||||
|
mcl_player.player_set_animation(player, "stand" , 30)
|
||||||
|
end
|
||||||
|
|
||||||
|
minetest.register_on_respawnplayer(detach_player)
|
||||||
|
|
||||||
function boat.on_rightclick(self, clicker)
|
function boat.on_rightclick(self, clicker)
|
||||||
if not clicker or not clicker:is_player() then
|
if not clicker or not clicker:is_player() then
|
||||||
return
|
return
|
||||||
@ -66,10 +75,7 @@ function boat.on_rightclick(self, clicker)
|
|||||||
local name = clicker:get_player_name()
|
local name = clicker:get_player_name()
|
||||||
if self._driver and clicker == self._driver then
|
if self._driver and clicker == self._driver then
|
||||||
self._driver = nil
|
self._driver = nil
|
||||||
clicker:set_detach()
|
detach_player(clicker)
|
||||||
clicker:set_properties({visual_size = {x=1, y=1}})
|
|
||||||
mcl_player.player_attached[name] = false
|
|
||||||
mcl_player.player_set_animation(clicker, "stand" , 30)
|
|
||||||
local pos = clicker:get_pos()
|
local pos = clicker:get_pos()
|
||||||
pos = {x = pos.x, y = pos.y + 0.2, z = pos.z}
|
pos = {x = pos.x, y = pos.y + 0.2, z = pos.z}
|
||||||
clicker:set_pos(pos)
|
clicker:set_pos(pos)
|
||||||
|
Loading…
Reference in New Issue
Block a user