Skip to content
Snippets Groups Projects
Verified Commit 7deb695f authored by codecraft's avatar codecraft :crocodile:
Browse files

fix: upper layers not working (probably)

parent 29022013
No related branches found
No related tags found
1 merge request!2fix: upper layers not working (probably)
......@@ -5,15 +5,16 @@ local leds = {
48,
36,
20,
16,
12,
8,
4
}
for i = 1, #leds do
if leds[i] % 4 ~= 0 then
error("[ledtree] led count per layer must be divisible by 4. Error location: 'leds' table, item "..i..": "..leds[i])
end
if leds[i] < 20 then
error("[ledtree] led count per layer must be greater than or qual to 20. Error location: 'leds' table, item "..i..": "..leds[i])
end
end
local height_increment = 3
......@@ -38,7 +39,7 @@ local function place_layer(center, breite)
breite = breite * 2 + 1
local needles = {}
local leds = {}
local max_offset = math.floor(breite / 2)
local max_offset = (breite - 1) / 2
for y = math.ceil(-height_increment / 2), math.floor(height_increment / 2) do
for x = -max_offset, max_offset do
for z = -max_offset, max_offset do
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment