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 a96c3fe3ac
commit 80a45c2c0d

View file

@ -494,6 +494,11 @@ local function do_detached_movement(self, dtime)
if away then if away then
local v = self.object:get_velocity() local v = self.object:get_velocity()
self.object:set_velocity(v - away) 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 end
-- Try to reconnect to rail -- Try to reconnect to rail