]> git.lizzy.rs Git - worldedit.git/commitdiff
Fix negative height pyramids (fixes #152)
authorsfan5 <sfan5@live.de>
Thu, 4 Jan 2018 00:03:51 +0000 (01:03 +0100)
committersfan5 <sfan5@live.de>
Thu, 4 Jan 2018 00:03:51 +0000 (01:03 +0100)
worldedit/primitives.lua

index 1bebfde31592920609887cd14ca05e2afdfa4ae5..0a7d1756f83d900ac2db8ef3807e99ac6ce79373 100644 (file)
@@ -208,12 +208,13 @@ function worldedit.pyramid(pos, axis, height, node_name, hollow)
        local other1, other2 = worldedit.get_axis_others(axis)\r
 \r
        -- Set up voxel manipulator\r
-       local manip, area = mh.init_axis_radius(pos, axis,\r
-                       height >= 0 and height or -height)\r
+       -- FIXME: passing negative <radius> causes mis-sorted pos to be passed\r
+       -- into mh.init() which is technically not allowed but works\r
+       local manip, area = mh.init_axis_radius(pos, axis, height)\r
        local data = mh.get_empty_data(area)\r
 \r
        -- Handle inverted pyramids\r
-       local start_axis, end_axis, step\r
+       local step\r
        if height > 0 then\r
                height = height - 1\r
                step = 1\r