Skip to content

Commit 2f4eb19

Browse files
committedSep 3, 2017
Fix one-node high cylinders
closes #146
1 parent 2cb3fcd commit 2f4eb19

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

Diff for: ‎worldedit/primitives.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ function worldedit.cylinder(pos, axis, length, radius1, radius2, node_name, holl
171171
local count = 0
172172
for i = 0, length - 1 do
173173
-- Calulate radius for this "height" in the cylinder
174-
local radius = radius1 + (radius2 - radius1) * i / (length - 1)
174+
local radius = radius1 + (radius2 - radius1) * (i + 1) / length
175175
radius = math.floor(radius + 0.5) -- round
176176
local min_radius, max_radius = radius * (radius - 1), radius * (radius + 1)
177177

0 commit comments

Comments
 (0)
Please sign in to comment.