Skip to content

Commit 2c12205

Browse files
pilino1234paramat
pilino1234
authored andcommittedNov 19, 2016
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.
1 parent c3f3406 commit 2c12205

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed
 

‎mods/boats/init.lua

+3-2
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ function boat.on_rightclick(self, clicker)
7979
minetest.after(0.2, function()
8080
default.player_set_animation(clicker, "sit" , 30)
8181
end)
82-
self.object:setyaw(clicker:get_look_horizontal() - math.pi / 2)
82+
clicker:set_look_horizontal(self.object:getyaw())
8383
end
8484
end
8585

@@ -231,7 +231,8 @@ minetest.register_craftitem("boats:boat", {
231231
return itemstack
232232
end
233233
pointed_thing.under.y = pointed_thing.under.y + 0.5
234-
minetest.add_entity(pointed_thing.under, "boats:boat")
234+
boat = minetest.add_entity(pointed_thing.under, "boats:boat")
235+
boat:setyaw(placer:get_look_horizontal())
235236
if not minetest.setting_getbool("creative_mode") then
236237
itemstack:take_item()
237238
end

0 commit comments

Comments
 (0)
Please sign in to comment.