]> git.lizzy.rs Git - worldedit.git/commitdiff
Fix small logic error in worldedit.cylinder
authorsfan5 <sfan5@live.de>
Thu, 31 Aug 2017 18:10:08 +0000 (20:10 +0200)
committersfan5 <sfan5@live.de>
Thu, 31 Aug 2017 18:10:08 +0000 (20:10 +0200)
worldedit/primitives.lua

index 4a09fbae01dd4bf2fb656ac09c565843f53c5c82..1b1b6853039fb073de0592e9641c8f42738c5bef 100644 (file)
@@ -171,7 +171,7 @@ function worldedit.cylinder(pos, axis, length, radius1, radius2, node_name, holl
        local count = 0\r
        for i = 0, length - 1 do\r
                -- Calulate radius for this "height" in the cylinder\r
-               local radius = radius1 + (radius2 - radius1) * (i - 1) / (length - 1)\r
+               local radius = radius1 + (radius2 - radius1) * i / (length - 1)\r
                radius = math.floor(radius + 0.5) -- round\r
                local min_radius, max_radius = radius * (radius - 1), radius * (radius + 1)\r
 \r