mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2025-04-22 23:25:15 +02:00
Only create biomes_lookup if one wasn't provided in the definition
This commit is contained in:
parent
3a54c67c4c
commit
9a34c124c1
1 changed files with 9 additions and 7 deletions
|
@ -279,13 +279,15 @@ function mcl_mobs:spawn_setup(def)
|
|||
minetest.log("warning", "Chance shouldn't be less than 1 (mob name: " .. name ..")")
|
||||
end
|
||||
|
||||
-- Create lookup table for biomes
|
||||
local biomes_lookup = {}
|
||||
def.biomes_lookup = biomes_lookup
|
||||
local biomes = def.biomes
|
||||
if biomes then
|
||||
for i=1,#def.biomes do
|
||||
biomes_lookup[biomes[i]] = true
|
||||
-- Create lookup table from biomes if one isn't provided
|
||||
if not def.biomes_lookup then
|
||||
local biomes_lookup = {}
|
||||
def.biomes_lookup = biomes_lookup
|
||||
local biomes = def.biomes
|
||||
if biomes then
|
||||
for i=1,#biomes do
|
||||
biomes_lookup[biomes[i]] = true
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue