Compare commits
2 Commits
0a2e22cb7c
...
4a44a80576
Author | SHA1 | Date |
---|---|---|
teknomunk | 4a44a80576 | |
teknomunk | bbd6ec7ff7 |
|
@ -67,6 +67,8 @@ local function detach_driver(self)
|
|||
--print("No player object found for "..driver_name)
|
||||
end
|
||||
end
|
||||
mod.detach_driver = detach_driver
|
||||
|
||||
function mod.kill_cart(staticdata, killer)
|
||||
local pos
|
||||
mcl_log("cart #"..staticdata.uuid.." was killed")
|
||||
|
@ -341,11 +343,12 @@ 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)
|
||||
|
|
|
@ -7,7 +7,7 @@ local mod = mcl_minecarts
|
|||
local PASSENGER_ATTACH_POSITION = mod.PASSENGER_ATTACH_POSITION
|
||||
|
||||
local function activate_normal_minecart(self)
|
||||
detach_driver(self)
|
||||
mod.detach_driver(self)
|
||||
|
||||
-- Detach passenger
|
||||
if self._passenger then
|
||||
|
|
|
@ -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