diff options
Diffstat (limited to 'railtrack')
-rw-r--r-- | railtrack/railtrack.lua | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/railtrack/railtrack.lua b/railtrack/railtrack.lua index 75a62a6..664300f 100644 --- a/railtrack/railtrack.lua +++ b/railtrack/railtrack.lua @@ -1,10 +1,11 @@ -RAILTRACK_MAX_SECTION_LEN = 20 -RAILTRACK_ROTATIONS = "FLR" -RAILTRACK_ACCEL_FLAT = -0.5 -RAILTRACK_ACCEL_UP = -2 -RAILTRACK_ACCEL_DOWN = 2 +local MAX_SECTION_LEN = 20 -railtrack = {} +railtrack = { + rotations = "FLR", + accel_flat = -0.5, + accel_up = -2, + accel_down = 2, +} railtrack.default_rail = { description = "Rail", @@ -90,7 +91,7 @@ function railtrack:limit_section_len(player, pos, meta) local junc = minetest.deserialize(s_junc) if #junc == 2 then local dist = railtrack:get_distance(junc[1], junc[2]) - if dist > RAILTRACK_MAX_SECTION_LEN then + if dist > MAX_SECTION_LEN then local node = minetest.get_node(pos) or {} if node.name then minetest.swap_node(pos, {name=node.name.."_union"}) |