forked from VoxeLibre/VoxeLibre
fix end sky and void crash
This commit is contained in:
parent
a2b003a195
commit
4b5476dbff
|
@ -177,7 +177,9 @@ function mcl_weather.rain.make_weather()
|
||||||
if mcl_weather.is_underwater(player) or not mcl_weather.has_rain(pos) then
|
if mcl_weather.is_underwater(player) or not mcl_weather.has_rain(pos) then
|
||||||
mcl_weather.rain.remove_sound(player)
|
mcl_weather.rain.remove_sound(player)
|
||||||
mcl_weather.remove_spawners_player(player)
|
mcl_weather.remove_spawners_player(player)
|
||||||
mcl_weather.set_sky_box_clear(player)
|
if mcl_worlds.has_weather(pos) then
|
||||||
|
mcl_weather.set_sky_box_clear(player)
|
||||||
|
end
|
||||||
else
|
else
|
||||||
if mcl_weather.has_snow(pos) then
|
if mcl_weather.has_snow(pos) then
|
||||||
mcl_weather.rain.remove_sound(player)
|
mcl_weather.rain.remove_sound(player)
|
||||||
|
|
|
@ -95,7 +95,7 @@ mcl_weather.skycolor = {
|
||||||
for _, player in ipairs(players) do
|
for _, player in ipairs(players) do
|
||||||
local pos = player:get_pos()
|
local pos = player:get_pos()
|
||||||
local dim = mcl_worlds.pos_to_dimension(pos)
|
local dim = mcl_worlds.pos_to_dimension(pos)
|
||||||
local has_weather = ((mcl_weather.state == "snow" or mcl_weather.state =="rain" or mcl_weather.state == "thunder") and mcl_weather.has_snow(pos)) or ((mcl_weather.state =="rain" or mcl_weather.state == "thunder") and mcl_weather.has_rain(pos))
|
local has_weather = (mcl_worlds.has_weather(pos) and (mcl_weather.state == "snow" or mcl_weather.state =="rain" or mcl_weather.state == "thunder") and mcl_weather.has_snow(pos)) or ((mcl_weather.state =="rain" or mcl_weather.state == "thunder") and mcl_weather.has_rain(pos))
|
||||||
if dim == "overworld" then
|
if dim == "overworld" then
|
||||||
if (mcl_weather.state == "none") then
|
if (mcl_weather.state == "none") then
|
||||||
-- Clear weather
|
-- Clear weather
|
||||||
|
|
|
@ -66,8 +66,8 @@ function mcl_weather.has_snow(pos)
|
||||||
if mgname == "singlenode" or mgname == "v6" then return false end
|
if mgname == "singlenode" or mgname == "v6" then return false end
|
||||||
local bn = minetest.get_biome_name(minetest.get_biome_data(pos).biome)
|
local bn = minetest.get_biome_name(minetest.get_biome_data(pos).biome)
|
||||||
local bd = minetest.registered_biomes[bn]
|
local bd = minetest.registered_biomes[bn]
|
||||||
if bd._mcl_biome_type == "snowy" then return true end
|
if bd and bd._mcl_biome_type == "snowy" then return true end
|
||||||
if bd._mcl_biome_type == "cold" then
|
if bd and bd._mcl_biome_type == "cold" then
|
||||||
if bn == "Taiga" and pos.y > 140 then return true end
|
if bn == "Taiga" and pos.y > 140 then return true end
|
||||||
if bn == "MegaSpruceTaiga" and pos.y > 100 then return true end
|
if bn == "MegaSpruceTaiga" and pos.y > 100 then return true end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue