From 2c122052d4332aa54b631091e718ba42500ec70a Mon Sep 17 00:00:00 2001 From: pilino1234 Date: Tue, 15 Nov 2016 22:08:12 +0100 Subject: [PATCH] Boats: Use player yaw on place, align player yaw with boat on enter MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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. --- mods/boats/init.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mods/boats/init.lua b/mods/boats/init.lua index 4c6937e8..26486f4e 100644 --- a/mods/boats/init.lua +++ b/mods/boats/init.lua @@ -79,7 +79,7 @@ function boat.on_rightclick(self, clicker) minetest.after(0.2, function() default.player_set_animation(clicker, "sit" , 30) end) - self.object:setyaw(clicker:get_look_horizontal() - math.pi / 2) + clicker:set_look_horizontal(self.object:getyaw()) end end @@ -231,7 +231,8 @@ minetest.register_craftitem("boats:boat", { return itemstack end 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 itemstack:take_item() end -- 2.25.1