mirror of
https://github.com/sbrl/Minetest-WorldEditAdditions.git
synced 2024-11-30 19:13:53 +01: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
@ -27,15 +27,14 @@ function worldeditadditions.scale_down(pos1, pos2, scale, direction)
|
||||
print("[DEBUG] scale_down", worldeditadditions.vector.tostring(scale_down))
|
||||
local size = vector.subtract(pos2, pos1)
|
||||
|
||||
local manip, area = worldedit.manip_helpers.init(pos1, pos2)
|
||||
local data = manip:get_data()
|
||||
local data_copy = worldeditadditions.shallowcopy(data)
|
||||
|
||||
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
|
||||
for i in area:iterp(pos1, pos2) do
|
||||
data_copy[i] = node_id_air
|
||||
|
Loading…
Reference in New Issue
Block a user