Fix flying carts

master
PilzAdam 2012-12-08 12:26:28 +01:00
parent 6fa24e3aed
commit 50eabe204c
1 changed files with 4 additions and 4 deletions

View File

@ -331,12 +331,12 @@ function cart:on_step(dtime)
}
-- Move cart exactly on the rail
if dir.x == 0 and not cart_func:is_int(self.velocity.x) then
pos.x = math.floor(0.5+pos.x)
self.object:setpos(pos)
elseif dir.z == 0 and not cart_func:is_int(self.velocity.z) then
if dir.x ~= 0 and not cart_func:is_int(pos.z) then
pos.z = math.floor(0.5+pos.z)
self.object:setpos(pos)
elseif dir.z ~= 0 and not cart_func:is_int(pos.x) then
pos.x = math.floor(0.5+pos.x)
self.object:setpos(pos)
end
-- Limit the velocity