Fix cart pitch when detached
This commit is contained in:
parent
b5bd02fa4f
commit
a4825a3332
|
@ -341,12 +341,13 @@ function DEFAULT_CART_DEF:on_step(dtime)
|
|||
end
|
||||
end
|
||||
|
||||
|
||||
if not staticdata.connected_at then
|
||||
do_detached_movement(self, dtime)
|
||||
end
|
||||
|
||||
else
|
||||
mod.update_cart_orientation(self)
|
||||
end
|
||||
end
|
||||
function DEFAULT_CART_DEF:on_death(killer)
|
||||
kill_cart(self._staticdata, killer)
|
||||
end
|
||||
|
|
|
@ -572,6 +572,12 @@ local function do_detached_movement(self, dtime)
|
|||
return
|
||||
end
|
||||
end
|
||||
|
||||
-- Reset pitch if still not attached
|
||||
local rot = self.object:get_rotation()
|
||||
minetest.log(vector.to_string(rot))
|
||||
rot.x = 0
|
||||
self.object:set_rotation(rot)
|
||||
end
|
||||
|
||||
--return do_movement, do_detatched_movement
|
||||
|
|
Loading…
Reference in New Issue