Forbidden the control over two boats by a single player

- Sent a chat message when a player wants to ride a new boat while he is
   attached on another one.
This commit is contained in:
LeMagnesium 2015-05-06 11:05:20 +02:00
parent 896d090e84
commit 95c37b3f1d
1 changed files with 11 additions and 7 deletions

View File

@ -52,13 +52,17 @@ boats.register_boat = function(parameters)
default.player_attached[name] = false
default.player_set_animation(clicker, "stand" , 30)
elseif not self.driver then
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
minetest.after(0.2, function()
default.player_set_animation(clicker, "sit" , 30)
end)
self.object:setyaw(clicker:get_look_yaw() - math.pi / 2)
if not default.player_attached[name] == true then
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
minetest.after(0.2, function()
default.player_set_animation(clicker, "sit" , 30)
end)
self.object:setyaw(clicker:get_look_yaw() - math.pi / 2)
else
minetest.chat_send_player(name, "You're already on a boat")
end
end
end