Boats: Fix player position (#1871)
authorRui <rui.minetest@gmail.com>
Sun, 13 Aug 2017 11:47:01 +0000 (20:47 +0900)
committerSmallJoker <SmallJoker@users.noreply.github.com>
Sun, 13 Aug 2017 11:47:01 +0000 (13:47 +0200)
mods/boats/depends.txt
mods/boats/init.lua

index 4ad96d51599fb734101f6229f6c1a8a509bd6255..8e482ce2fe8a5b8eb87bd653ad13c93d7b83c2b1 100644 (file)
@@ -1 +1,2 @@
 default
+player_api
index 4d8f4673db205aff05cd8ace8fdddeb6d050635b..38025d165a447a7d31cffd701bedc8859ae19ee6 100644 (file)
@@ -56,8 +56,8 @@ function boat.on_rightclick(self, clicker)
        if self.driver and clicker == self.driver then
                self.driver = nil
                clicker:set_detach()
-               default.player_attached[name] = false
-               default.player_set_animation(clicker, "stand" , 30)
+               player_api.player_attached[name] = false
+               player_api.set_animation(clicker, "stand" , 30)
                local pos = clicker:getpos()
                pos = {x = pos.x, y = pos.y + 0.2, z = pos.z}
                minetest.after(0.1, function()
@@ -74,10 +74,10 @@ function boat.on_rightclick(self, clicker)
                end
                self.driver = clicker
                clicker:set_attach(self.object, "",
-                       {x = 0, y = 11, z = -3}, {x = 0, y = 0, z = 0})
-               default.player_attached[name] = true
+                       {x = 0.5, y = 1, z = -3}, {x = 0, y = 0, z = 0})
+               player_api.player_attached[name] = true
                minetest.after(0.2, function()
-                       default.player_set_animation(clicker, "sit" , 30)
+                       player_api.set_animation(clicker, "sit" , 30)
                end)
                clicker:set_look_horizontal(self.object:getyaw())
        end
@@ -105,7 +105,7 @@ function boat.on_punch(self, puncher)
        if self.driver and puncher == self.driver then
                self.driver = nil
                puncher:set_detach()
-               default.player_attached[puncher:get_player_name()] = false
+               player_api.player_attached[puncher:get_player_name()] = false
        end
        if not self.driver then
                self.removed = true