mirror of
https://codeberg.org/minenux/minetest-mod-xdecor
synced 2023-10-20 21:43:39 -07:00
eye height adjusted to the new mtgame
* backported 02b8ef8832
* still pending to test.. seems works
This commit is contained in:
parent
bfee841c7a
commit
aa199f90e4
@ -1,3 +1,5 @@
|
|||||||
|
local p_api = minetest.get_modpath("player_api")
|
||||||
|
|
||||||
local function top_face(pointed_thing)
|
local function top_face(pointed_thing)
|
||||||
if not pointed_thing then return end
|
if not pointed_thing then return end
|
||||||
return pointed_thing.above.y > pointed_thing.under.y
|
return pointed_thing.above.y > pointed_thing.under.y
|
||||||
@ -9,6 +11,7 @@ function xdecor.sit(pos, node, clicker, pointed_thing)
|
|||||||
local objs = minetest.get_objects_inside_radius(pos, 0.1)
|
local objs = minetest.get_objects_inside_radius(pos, 0.1)
|
||||||
local vel = clicker:get_player_velocity()
|
local vel = clicker:get_player_velocity()
|
||||||
local ctrl = clicker:get_player_control()
|
local ctrl = clicker:get_player_control()
|
||||||
|
local eyey = -7
|
||||||
|
|
||||||
for _, obj in pairs(objs) do
|
for _, obj in pairs(objs) do
|
||||||
if obj:is_player() and obj:get_player_name() ~= player_name then
|
if obj:is_player() and obj:get_player_name() ~= player_name then
|
||||||
@ -26,8 +29,8 @@ function xdecor.sit(pos, node, clicker, pointed_thing)
|
|||||||
|
|
||||||
elseif not default.player_attached[player_name] and node.param2 <= 3 and
|
elseif not default.player_attached[player_name] and node.param2 <= 3 and
|
||||||
not ctrl.sneak and vector.equals(vel, vector.new()) then
|
not ctrl.sneak and vector.equals(vel, vector.new()) then
|
||||||
|
if p_api then eyey = 0 end
|
||||||
clicker:set_eye_offset({x = 0, y = -7, z = 2}, vector.new())
|
clicker:set_eye_offset({x = 0, y = eyey, z = 2}, vector.new())
|
||||||
clicker:set_physics_override({speed = 0, jump = 0, gravity = 1})
|
clicker:set_physics_override({speed = 0, jump = 0, gravity = 1})
|
||||||
clicker:set_pos(pos)
|
clicker:set_pos(pos)
|
||||||
default.player_attached[player_name] = true
|
default.player_attached[player_name] = true
|
||||||
|
Loading…
x
Reference in New Issue
Block a user