mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-19 01:21:05 +01:00
Fix crash for sky colour if cannot find biome
This commit is contained in:
parent
46052e5b7e
commit
df6d1c026a
1 changed files with 10 additions and 3 deletions
|
@ -136,9 +136,16 @@ mcl_weather.skycolor = {
|
||||||
local biomesky
|
local biomesky
|
||||||
local biomefog
|
local biomefog
|
||||||
if mg_name ~= "v6" and mg_name ~= "singlenode" then
|
if mg_name ~= "v6" and mg_name ~= "singlenode" then
|
||||||
local biome = minetest.get_biome_name(minetest.get_biome_data(player:get_pos()).biome)
|
local biome_index = minetest.get_biome_data(player:get_pos()).biome
|
||||||
biomesky = minetest.registered_biomes[biome]._mcl_skycolor
|
local biome_name = minetest.get_biome_name(biome_index)
|
||||||
biomefog = minetest.registered_biomes[biome]._mcl_fogcolor
|
local biome = minetest.registered_biomes[biome_name]
|
||||||
|
if biome then
|
||||||
|
--minetest.log("action", string.format("Biome found for number: %s in biome: %s", tostring(biome_index), biome_name))
|
||||||
|
biomesky = biome._mcl_skycolor
|
||||||
|
biomefog = biome._mcl_fogcolor
|
||||||
|
else
|
||||||
|
--minetest.log("action", string.format("No biome for number: %s in biome: %s", tostring(biome_index), biome_name))
|
||||||
|
end
|
||||||
end
|
end
|
||||||
if (mcl_weather.state == "none") then
|
if (mcl_weather.state == "none") then
|
||||||
-- Clear weather
|
-- Clear weather
|
||||||
|
|
Loading…
Reference in a new issue