Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Boats: Fix player position (#1871)
  • Loading branch information
Rui authored and SmallJoker committed Aug 13, 2017
1 parent c5e9786 commit fe710c9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions mods/boats/depends.txt
@@ -1 +1,2 @@
default
player_api
12 changes: 6 additions & 6 deletions mods/boats/init.lua
Expand Up @@ -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()
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit fe710c9

Please sign in to comment.