mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-28 05:21:05 +01:00
Give carts a small vertical lift when pushed to allow them to get back on rails
This commit is contained in:
parent
a96c3fe3ac
commit
80a45c2c0d
1 changed files with 5 additions and 0 deletions
|
@ -494,6 +494,11 @@ local function do_detached_movement(self, dtime)
|
|||
if away then
|
||||
local v = self.object:get_velocity()
|
||||
self.object:set_velocity(v - away)
|
||||
|
||||
-- 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))
|
||||
end
|
||||
|
||||
-- Try to reconnect to rail
|
||||
|
|
Loading…
Reference in a new issue