Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove eye offsetting hacks #2918

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions mods/beds/functions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,13 @@ local function lay_down(player, pos, bed_pos, state, skip)
end
player:set_pos(beds.pos[name])

-- physics, eye_offset, etc
local physics_override = beds.player[name].physics_override
beds.player[name] = nil
player:set_physics_override({
speed = physics_override.speed,
jump = physics_override.jump,
gravity = physics_override.gravity
})
player:set_eye_offset({x = 0, y = 0, z = 0}, {x = 0, y = 0, z = 0})
player:set_look_horizontal(math.random(1, 180) / 100)
player_api.player_attached[name] = false
hud_flags.wielditem = true
Expand Down
2 changes: 0 additions & 2 deletions mods/carts/functions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,12 @@ function carts:manage_attachment(player, obj)

if status then
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_api does not update the animation
-- when the player is attached, reset to default animation
player_api.set_animation(player, "stand")
else
player:set_detach()
player:set_eye_offset({x=0, y=0, z=0},{x=0, y=0, z=0})
end
end

Expand Down