1
0
Fork 0

Merge pull request 'Fix crash for sky colour if cannot find biome' (#3239) from fix_colour_crash_risk into master

Reviewed-on: https://git.minetest.land/MineClone2/MineClone2/pulls/3239
Reviewed-by: Michieal <michieal@noreply.git.minetest.land>
update_german_translation_attempt2
ancientmarinerdev 2023-01-03 01:02:19 +00:00
commit 0fca1ce469
1 changed files with 10 additions and 3 deletions

View File

@ -136,9 +136,16 @@ mcl_weather.skycolor = {
local biomesky
local biomefog
if mg_name ~= "v6" and mg_name ~= "singlenode" then
local biome = minetest.get_biome_name(minetest.get_biome_data(player:get_pos()).biome)
biomesky = minetest.registered_biomes[biome]._mcl_skycolor
biomefog = minetest.registered_biomes[biome]._mcl_fogcolor
local biome_index = minetest.get_biome_data(player:get_pos()).biome
local biome_name = minetest.get_biome_name(biome_index)
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
if (mcl_weather.state == "none") then
-- Clear weather