Give carts a small vertical lift when pushed to allow them to get back on rails

This commit is contained in:
teknomunk 2024-04-12 07:37:34 +00:00
parent 57080d0a3d
commit 3fc35d1ea4
1 changed files with 5 additions and 0 deletions

View File

@ -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