Merge pull request #502 from Coethium/mff.carts

[Carts] Requests improvments
This commit is contained in:
Coethium 2016-08-11 23:31:52 +02:00 committed by GitHub
commit aaf5ca5a87
1 changed files with 4 additions and 1 deletions

View File

@ -63,6 +63,8 @@ function carts.cart:on_rightclick(clicker)
if self.driver and player_name == self.driver then
self.driver = nil
carts:manage_attachment(clicker, false)
self.object:setacceleration({x=0, y=0, z=0}) -- Stops the cart when we leave it
self.object:setvelocity({x=0, y=0, z=0})
elseif not self.driver then
self.driver = player_name
carts:manage_attachment(clicker, true, self.object)
@ -138,7 +140,7 @@ function carts.cart:on_punch(puncher, time_from_last_punch, tool_capabilities, d
if math.abs(vel.x + vel.z) > carts.punch_speed_min then
return
end
end
--end --Only the driver can punch
local punch_dir = carts:velocity_to_dir(puncher:get_look_dir())
punch_dir.y = 0
@ -158,6 +160,7 @@ function carts.cart:on_punch(puncher, time_from_last_punch, tool_capabilities, d
self.old_dir = cart_dir
self.old_pos = nil
self.punched = true
end
end
function carts.cart:on_step(dtime)