Fix some crashes, but it's still not functioning as expected

This commit is contained in:
Starbeamrainbowlabs 2020-09-13 22:57:26 +01:00
parent 0b285fa681
commit a6fc9712b4
Signed by: sbrl
GPG key ID: 1BE5172E637709C2
2 changed files with 5 additions and 4 deletions

View file

@ -24,7 +24,7 @@ function worldeditadditions.forest(pos1, pos2, sapling_weights)
for x = pos2.x, pos1.x, -1 do
for y = pos2.y, pos1.y, -1 do
local i = area:index(x, y, z)
if not groups_cache[data[i]] then
if not group_cache[data[i]] then
group_cache[data[i]] = worldeditadditions.is_sapling(data[i])
end
@ -38,7 +38,7 @@ function worldeditadditions.forest(pos1, pos2, sapling_weights)
)
local new_id_at_pos = minetest.get_content_id(minetest.get_node({ z = z, y = y, x = x }).name)
if not groups_cache[new_id_at_pos] then
if not group_cache[new_id_at_pos] then
group_cache[new_id_at_pos] = worldeditadditions.is_sapling(new_id_at_pos)
end
if not group_cache[new_id_at_pos] then
@ -64,7 +64,7 @@ function worldeditadditions.forest(pos1, pos2, sapling_weights)
for x = pos2.x, pos1.x, -1 do
for y = pos2.y, pos1.y, -1 do
local i = area:index(x, y, z)
if not groups_cache[data[i]] then
if not group_cache[data[i]] then
group_cache[data[i]] = worldeditadditions.is_sapling(data[i])
end

View file

@ -32,9 +32,10 @@ dofile(we_c.modpath.."/commands/maze.lua")
dofile(we_c.modpath.."/commands/replacemix.lua")
dofile(we_c.modpath.."/commands/convolve.lua")
dofile(we_c.modpath.."/commands/erode.lua")
dofile(we_c.modpath.."/commands/forest.lua")
dofile(we_c.modpath.."/commands/count.lua")
dofile(we_c.modpath.."/commands/forestaliases.lua")
dofile(we_c.modpath.."/commands/saplingaliases.lua")
dofile(we_c.modpath.."/commands/subdivide.lua")