forked from VoxeLibre/VoxeLibre
Minecarts: Reset eye offset when detaching player
This commit is contained in:
parent
5a1cafa5dd
commit
e42945a4e1
|
@ -65,6 +65,7 @@ local function register_entity(entity_id, mesh, textures, drop, on_rightclick)
|
||||||
local player = minetest.get_player_by_name(self._driver)
|
local player = minetest.get_player_by_name(self._driver)
|
||||||
if player then
|
if player then
|
||||||
player:set_detach()
|
player:set_detach()
|
||||||
|
player:set_eye_offset({x=0, y=0, z=0},{x=0, y=0, z=0})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -434,8 +435,7 @@ register_minecart(
|
||||||
self._driver = nil
|
self._driver = nil
|
||||||
self._start_pos = nil
|
self._start_pos = nil
|
||||||
clicker:set_detach()
|
clicker:set_detach()
|
||||||
local player = minetest.get_player_by_name(name)
|
clicker:set_eye_offset({x=0, y=0, z=0},{x=0, y=0, z=0})
|
||||||
player:set_eye_offset({x=0, y=0, z=0},{x=0, y=0, z=0})
|
|
||||||
elseif not self._driver then
|
elseif not self._driver then
|
||||||
self._driver = player_name
|
self._driver = player_name
|
||||||
self._start_pos = self.object:getpos()
|
self._start_pos = self.object:getpos()
|
||||||
|
|
Loading…
Reference in New Issue