forked from mtcontrib/boost_cart
Break too long lines and simplify the code
- Add boost_cart:get_rail_groups to get the default rail groups - Remove duplicated code - Do not boost the cart backwards when the brake rail gets activated - Attempt to fix the cart swing problem - Trim tailings and tidy up code - TODO: Document all the stuff
This commit is contained in:
@ -213,3 +213,14 @@ function boost_cart:register_rail(name, def)
|
||||
|
||||
minetest.register_node(name, def)
|
||||
end
|
||||
|
||||
function boost_cart:get_rail_groups(additional_groups)
|
||||
-- Get the default rail groups and add more when a table is given
|
||||
local groups = {dig_immediate = 2, attached_node = 1, rail = 1, connect_to_raillike = 1}
|
||||
if type(additional_groups) == "table" then
|
||||
for k, v in pairs(additional_groups) do
|
||||
groups[k] = v
|
||||
end
|
||||
end
|
||||
return groups
|
||||
end
|
||||
|
Reference in New Issue
Block a user