mirror of
https://github.com/Uberi/Minetest-WorldEdit.git
synced 2024-12-25 10:10:41 +01:00
Fix negative height pyramids (fixes #152)
This commit is contained in:
parent
b259906fd0
commit
3322ef90c4
@ -208,12 +208,13 @@ function worldedit.pyramid(pos, axis, height, node_name, hollow)
|
|||||||
local other1, other2 = worldedit.get_axis_others(axis)
|
local other1, other2 = worldedit.get_axis_others(axis)
|
||||||
|
|
||||||
-- Set up voxel manipulator
|
-- Set up voxel manipulator
|
||||||
local manip, area = mh.init_axis_radius(pos, axis,
|
-- FIXME: passing negative <radius> causes mis-sorted pos to be passed
|
||||||
height >= 0 and height or -height)
|
-- into mh.init() which is technically not allowed but works
|
||||||
|
local manip, area = mh.init_axis_radius(pos, axis, height)
|
||||||
local data = mh.get_empty_data(area)
|
local data = mh.get_empty_data(area)
|
||||||
|
|
||||||
-- Handle inverted pyramids
|
-- Handle inverted pyramids
|
||||||
local start_axis, end_axis, step
|
local step
|
||||||
if height > 0 then
|
if height > 0 then
|
||||||
height = height - 1
|
height = height - 1
|
||||||
step = 1
|
step = 1
|
||||||
|
Loading…
Reference in New Issue
Block a user