mirror of
git://repo.or.cz/minetest_schemedit.git
synced 2025-01-09 17:40:32 +01:00
Increase area cleaning size to full XZ extent
This commit is contained in:
parent
98b3ae87ea
commit
3b9f1b867b
7
init.lua
7
init.lua
@ -1329,10 +1329,13 @@ minetest.register_chatcommand("placeschem", {
|
|||||||
local schematic = minetest.read_schematic(schem_path, {})
|
local schematic = minetest.read_schematic(schem_path, {})
|
||||||
if schematic then
|
if schematic then
|
||||||
if clear then
|
if clear then
|
||||||
|
-- Clear same size for X and Z because
|
||||||
|
-- because schematic is randomly rotated
|
||||||
|
local max_xz = math.max(schematic.size.x, schematic.size.z)
|
||||||
local posses = {}
|
local posses = {}
|
||||||
for z=pos.z, pos.z+schematic.size.z-1 do
|
for z=pos.z, pos.z+max_xz-1 do
|
||||||
for y=pos.y, pos.y+schematic.size.y-1 do
|
for y=pos.y, pos.y+schematic.size.y-1 do
|
||||||
for x=pos.x, pos.x+schematic.size.x-1 do
|
for x=pos.x, pos.x+max_xz-1 do
|
||||||
table.insert(posses, {x=x,y=y,z=z})
|
table.insert(posses, {x=x,y=y,z=z})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user