Boats: Use player yaw on place, align player yaw with boat on enter
When placing boats, align the boat with the player's yaw. Align drivers yaw with boat yaw when entering a boat, would previously turn boat yaw by player's yaw + 90° to the right.
This commit is contained in:
parent
c3f3406e8e
commit
2c122052d4
@ -79,7 +79,7 @@ function boat.on_rightclick(self, clicker)
|
|||||||
minetest.after(0.2, function()
|
minetest.after(0.2, function()
|
||||||
default.player_set_animation(clicker, "sit" , 30)
|
default.player_set_animation(clicker, "sit" , 30)
|
||||||
end)
|
end)
|
||||||
self.object:setyaw(clicker:get_look_horizontal() - math.pi / 2)
|
clicker:set_look_horizontal(self.object:getyaw())
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -231,7 +231,8 @@ minetest.register_craftitem("boats:boat", {
|
|||||||
return itemstack
|
return itemstack
|
||||||
end
|
end
|
||||||
pointed_thing.under.y = pointed_thing.under.y + 0.5
|
pointed_thing.under.y = pointed_thing.under.y + 0.5
|
||||||
minetest.add_entity(pointed_thing.under, "boats:boat")
|
boat = minetest.add_entity(pointed_thing.under, "boats:boat")
|
||||||
|
boat:setyaw(placer:get_look_horizontal())
|
||||||
if not minetest.setting_getbool("creative_mode") then
|
if not minetest.setting_getbool("creative_mode") then
|
||||||
itemstack:take_item()
|
itemstack:take_item()
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user