mirror of
https://github.com/SmallJoker/boost_cart.git
synced 2024-11-27 08:53:45 +01:00
Confinue driving
This commit is contained in:
parent
717721c912
commit
2929d2ceb7
@ -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
|
||||
|
||||
|
2
init.lua
2
init.lua
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user