Trying to fix cart for 0.2 server_step. Not really helping on turns.
parent
98216810ef
commit
e95a55c83b
|
@ -223,6 +223,12 @@ local function rail_on_step(self, dtime)
|
|||
-- No rail found: reset back to the expected position
|
||||
pos = vector.new(self.old_pos)
|
||||
update.pos = true
|
||||
--stop the madness
|
||||
self.object:setvelocity({x=0,y=0,z=0})
|
||||
self.old_vel = {x = 0, y = 0, z = 0}
|
||||
self.object:setacceleration({x = 0, y = 0, z = 0})
|
||||
self.velocity = {x = 0, y = 0, z = 0}
|
||||
--it won't stop :(
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -163,7 +163,7 @@ function carts:pathfinder(pos_, old_pos, old_dir, ctrl, pf_switch, railtype)
|
|||
local pf_pos = vector.round(old_pos)
|
||||
local pf_dir = vector.new(old_dir)
|
||||
|
||||
for i = 1, 3 do
|
||||
for i = 1, 5 do
|
||||
if vector.equals(pf_pos, pos) then
|
||||
-- Success! Cart moved on correctly
|
||||
return true
|
||||
|
|
Loading…
Reference in New Issue