Remove dip into the ground that occured when gravity caused the cart to reverse directions
This commit is contained in:
parent
adb44f9837
commit
970e83de8b
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue