Remove dip into the ground that occured when gravity caused the cart to reverse directions

This commit is contained in:
teknomunk 2024-03-09 16:06:11 +00:00
parent adb44f9837
commit 970e83de8b
1 changed files with 6 additions and 7 deletions

View File

@ -522,14 +522,13 @@ local function register_entity(entity_id, mesh, textures, drop, on_rightclick, o
if DEBUG then if DEBUG then
print("Gravity flipped direction") print("Gravity flipped direction")
end end
staticdata.velocity = staticdata.velocity * -1
-- Update direction -- Complete moving thru this block into the next, reverse direction, and put us back at the same position we were at
local next_dir,_ = mcl_minecarts:get_rail_direction(pos + staticdata.dir, staticdata.dir * -1, nil, nil, staticdata.railtype) staticdata.velocity = staticdata.velocity * -1
if DEBUG and next_dir ~= staticdata.dir then staticdata.dir = -staticdata.dir
print( "Changing direction from "..tostring(staticdata.dir).." to "..tostring(next_dir)) pos = pos + staticdata.dir
end staticdata.distance = 1 - staticdata.distance
staticdata.dir = next_dir staticdata.connected_at = pos
update_cart_orientation(self,staticdata) update_cart_orientation(self,staticdata)
end end