From b9c197565a4c66f6b20ee0cc9abf684c34bdd551 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Wed, 30 Jan 2019 01:58:26 +0100 Subject: [PATCH] Minecarts: Init _railtype on placement --- mods/ENTITIES/mcl_minecarts/init.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mods/ENTITIES/mcl_minecarts/init.lua b/mods/ENTITIES/mcl_minecarts/init.lua index 33014228a..5aac4f0a6 100644 --- a/mods/ENTITIES/mcl_minecarts/init.lua +++ b/mods/ENTITIES/mcl_minecarts/init.lua @@ -323,6 +323,10 @@ mcl_minecarts.place_minecart = function(itemstack, pointed_thing) local entity_id = entity_mapping[itemstack:get_name()] local cart = minetest.add_entity(railpos, entity_id) local railtype = minetest.get_item_group(node.name, "connect_to_raillike") + local le = cart:get_luaentity() + if le ~= nil then + le._railtype = railtype + end local cart_dir = mcl_minecarts:get_rail_direction(railpos, {x=1, y=0, z=0}, nil, nil, railtype) cart:setyaw(minetest.dir_to_yaw(cart_dir))