From 0e9a29ddfc38ce8c198be21bd9597a7d5f03a9d4 Mon Sep 17 00:00:00 2001 From: stujones11 Date: Fri, 22 Jan 2016 18:54:56 +0000 Subject: Set cart pitch and yaw on placement --- railcart/init.lua | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'railcart/init.lua') diff --git a/railcart/init.lua b/railcart/init.lua index 7ca7fe2..8d60051 100644 --- a/railcart/init.lua +++ b/railcart/init.lua @@ -165,12 +165,16 @@ minetest.register_craftitem("railcart:cart", { return end end + local cons = railtrack:get_connections(pos) local cart = railcart.cart:new() cart.id = #railcart.allcarts + 1 cart.inv = railcart:create_detached_inventory(cart.id) cart.pos = pos cart.prev = vector.new(pos) cart.accel = railtrack:get_acceleration(pos) + if cons[1] then + cart.target = cons[1] + end table.insert(railcart.allcarts, cart) railcart:save() if not minetest.setting_getbool("creative_mode") then -- cgit v1.2.3