mirror of
https://github.com/sbrl/Minetest-WorldEditAdditions.git
synced 2024-12-23 03:55:01 +00:00
scale_down: fix a number of runtime errors
Note that we still haven't tested it :P
This commit is contained in:
parent
0d5e71eb4f
commit
756c1c12f2
1 changed files with 2 additions and 3 deletions
|
@ -27,15 +27,14 @@ function worldeditadditions.scale_down(pos1, pos2, scale, direction)
|
||||||
print("[DEBUG] scale_down", worldeditadditions.vector.tostring(scale_down))
|
print("[DEBUG] scale_down", worldeditadditions.vector.tostring(scale_down))
|
||||||
local size = vector.subtract(pos2, pos1)
|
local size = vector.subtract(pos2, pos1)
|
||||||
|
|
||||||
|
local manip, area = worldedit.manip_helpers.init(pos1, pos2)
|
||||||
local data = manip:get_data()
|
local data = manip:get_data()
|
||||||
local data_copy = worldeditadditions.shallowcopy(data)
|
local data_copy = worldeditadditions.shallowcopy(data)
|
||||||
|
|
||||||
local node_id_air = minetest.get_content_id("air")
|
local node_id_air = minetest.get_content_id("air")
|
||||||
|
|
||||||
|
|
||||||
local count = 0 -- The number of nodes replaced
|
local stats = { updated = 0, scale = "scale_down" }
|
||||||
|
|
||||||
local stats = { updated = 0, scale = scale_down }
|
|
||||||
-- Zero out the area we're scaling down into
|
-- Zero out the area we're scaling down into
|
||||||
for i in area:iterp(pos1, pos2) do
|
for i in area:iterp(pos1, pos2) do
|
||||||
data_copy[i] = node_id_air
|
data_copy[i] = node_id_air
|
||||||
|
|
Loading…
Reference in a new issue