Fix a very rare bug, add rubber tree if moretrees is there.
This commit is contained in:
parent
f3f38ba23c
commit
66562f5c49
@ -2,3 +2,4 @@ default
|
|||||||
farming
|
farming
|
||||||
wool
|
wool
|
||||||
stairs
|
stairs
|
||||||
|
moretrees?
|
||||||
|
20
trees.lua
20
trees.lua
@ -200,3 +200,23 @@ mg.register_tree({
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
|
function mg.get_spawn_tree_func(treedef)
|
||||||
|
return function(data, a, x, y, z, minp, maxp, pr)
|
||||||
|
if minp.y <= y and y <= maxp.y then
|
||||||
|
minetest.after(0, minetest.spawn_tree, {x=x, y=y, z=z}, treedef)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if minetest.get_modpath("moretrees") then
|
||||||
|
mg.register_tree({
|
||||||
|
min_humidity = 0,
|
||||||
|
min_temperature = 0.2,
|
||||||
|
min_height = 1,
|
||||||
|
max_height = 5,
|
||||||
|
grows_on = c_grass,
|
||||||
|
chance = 800,
|
||||||
|
grow = mg.get_spawn_tree_func(moretrees.rubber_tree_model)
|
||||||
|
})
|
||||||
|
end
|
||||||
|
@ -34,7 +34,7 @@ local function choose_building(l, pr)
|
|||||||
while true do
|
while true do
|
||||||
local p = pr:next(1, 3000)
|
local p = pr:next(1, 3000)
|
||||||
for b, i in ipairs(buildings) do
|
for b, i in ipairs(buildings) do
|
||||||
if i.max_weight > p then
|
if i.max_weight >= p then
|
||||||
btype = b
|
btype = b
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user