mirror of
https://github.com/Uberi/Minetest-WorldEdit.git
synced 2024-12-25 18:20:38 +01:00
Fix small logic error in worldedit.cylinder
This commit is contained in:
parent
870873ad15
commit
e680d8087e
@ -171,7 +171,7 @@ function worldedit.cylinder(pos, axis, length, radius1, radius2, node_name, holl
|
|||||||
local count = 0
|
local count = 0
|
||||||
for i = 0, length - 1 do
|
for i = 0, length - 1 do
|
||||||
-- Calulate radius for this "height" in the cylinder
|
-- Calulate radius for this "height" in the cylinder
|
||||||
local radius = radius1 + (radius2 - radius1) * (i - 1) / (length - 1)
|
local radius = radius1 + (radius2 - radius1) * i / (length - 1)
|
||||||
radius = math.floor(radius + 0.5) -- round
|
radius = math.floor(radius + 0.5) -- round
|
||||||
local min_radius, max_radius = radius * (radius - 1), radius * (radius + 1)
|
local min_radius, max_radius = radius * (radius - 1), radius * (radius + 1)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user