mirror of
https://github.com/minetest/minetest_game.git
synced 2024-12-23 07:10:19 +01:00
Carts: Fix player position (#1872)
This commit is contained in:
parent
fe710c99a6
commit
b431ae1c77
@ -1 +1,2 @@
|
|||||||
default
|
default
|
||||||
|
player_api
|
||||||
|
@ -12,13 +12,13 @@ function carts:manage_attachment(player, obj)
|
|||||||
end
|
end
|
||||||
local status = obj ~= nil
|
local status = obj ~= nil
|
||||||
local player_name = player:get_player_name()
|
local player_name = player:get_player_name()
|
||||||
if default.player_attached[player_name] == status then
|
if player_api.player_attached[player_name] == status then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
default.player_attached[player_name] = status
|
player_api.player_attached[player_name] = status
|
||||||
|
|
||||||
if status then
|
if status then
|
||||||
player:set_attach(obj, "", {x=0, y=6, z=0}, {x=0, y=0, z=0})
|
player:set_attach(obj, "", {x=0, y=-4.5, z=0}, {x=0, y=0, z=0})
|
||||||
player:set_eye_offset({x=0, y=-4, z=0},{x=0, y=-4, z=0})
|
player:set_eye_offset({x=0, y=-4, z=0},{x=0, y=-4, z=0})
|
||||||
else
|
else
|
||||||
player:set_detach()
|
player:set_detach()
|
||||||
|
@ -11,10 +11,4 @@ carts.punch_speed_max = 5
|
|||||||
|
|
||||||
dofile(carts.modpath.."/functions.lua")
|
dofile(carts.modpath.."/functions.lua")
|
||||||
dofile(carts.modpath.."/rails.lua")
|
dofile(carts.modpath.."/rails.lua")
|
||||||
|
|
||||||
-- Support for non-default games
|
|
||||||
if not default.player_attached then
|
|
||||||
default.player_attached = {}
|
|
||||||
end
|
|
||||||
|
|
||||||
dofile(carts.modpath.."/cart_entity.lua")
|
dofile(carts.modpath.."/cart_entity.lua")
|
||||||
|
Loading…
Reference in New Issue
Block a user