Confinue driving

This commit is contained in:
SmallJoker 2014-11-08 20:05:03 +01:00
parent 717721c912
commit 2929d2ceb7
2 changed files with 12 additions and 1 deletions

View File

@ -16,6 +16,17 @@ end
function boost_cart:is_rail(pos)
local node = minetest.get_node(pos).name
if node == "ignore" then
local vm = minetest.get_voxel_manip()
local emin, emax = vm:read_from_map(pos, pos)
local area = VoxelArea:new{
MinEdge = emin,
MaxEdge = emax,
}
local data = vm:get_data()
local vi = area:indexp(pos)
node = minetest.get_name_from_content_id(data[vi])
end
return minetest.get_item_group(node, "rail") ~= 0
end

View File

@ -3,7 +3,7 @@
boost_cart = {}
boost_cart.modpath = minetest.get_modpath("boost_cart")
boost_cart.speed_max = 10
boost_cart.speed_max = 11
function vector.floor(v)
return {