mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2025-01-09 00:29:33 +01:00
Limit detached cart vertical boost to no more than what is needed to get over the lip of rails
This commit is contained in:
parent
cacc9d384f
commit
6898675e05
1 changed files with 3 additions and 1 deletions
|
@ -573,7 +573,9 @@ function submod.do_detached_movement(self, dtime)
|
|||
-- Boost the minecart vertically a bit to get over the edge of rails and things like carpets
|
||||
local boost = vector.offset(vector.multiply(vector.normalize(away), 0.1), 0, 0.07, 0) -- 1/16th + 0.0075
|
||||
local pos = self.object:get_pos()
|
||||
self.object:set_pos(vector.add(pos,boost))
|
||||
if pos.y - math.floor(pos.y) < boost.y then
|
||||
self.object:set_pos(vector.add(pos,boost))
|
||||
end
|
||||
end
|
||||
|
||||
-- Try to reconnect to rail
|
||||
|
|
Loading…
Reference in a new issue