diff options
author | sfan5 <sfan5@live.de> | 2017-09-03 20:11:31 +0200 |
---|---|---|
committer | sfan5 <sfan5@live.de> | 2017-09-03 20:12:38 +0200 |
commit | 2f4eb19a3afa73b95fd5ce50011c3292dec8bbc2 (patch) | |
tree | 97bd06f30daea86c56de81300166fd6afa28326e | |
parent | 2cb3fcde66711497f7506f434f7c89c7fbfa7194 (diff) |
Fix one-node high cylinders
closes #146
-rw-r--r-- | worldedit/primitives.lua | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/worldedit/primitives.lua b/worldedit/primitives.lua index 1b1b685..1bebfde 100644 --- a/worldedit/primitives.lua +++ b/worldedit/primitives.lua @@ -171,7 +171,7 @@ function worldedit.cylinder(pos, axis, length, radius1, radius2, node_name, holl local count = 0
for i = 0, length - 1 do
-- Calulate radius for this "height" in the cylinder
- local radius = radius1 + (radius2 - radius1) * i / (length - 1)
+ local radius = radius1 + (radius2 - radius1) * (i + 1) / length
radius = math.floor(radius + 0.5) -- round
local min_radius, max_radius = radius * (radius - 1), radius * (radius + 1)
|