Fix weather sky color issues

But also disable void blackness
This commit is contained in:
Wuzzy 2017-02-21 04:20:43 +01:00
parent 6d9eeb24ec
commit edde01d582
2 changed files with 8 additions and 7 deletions

View File

@ -25,19 +25,16 @@ local rng = PcgRandom(32321123312123)
local ps = {} local ps = {}
local ttl = 1 local ttl = 1
local revertsky = function() local revertsky = function(dtime)
if ttl == 0 then if ttl == 0 then
return return
end end
ttl = ttl - 1 ttl = ttl - dtime
if ttl > 0 then if ttl > 0 then
return return
end end
for key, entry in pairs(ps) do skycolor.remove_layer("lightning")
local sky = entry.sky
entry.p:set_sky(sky.bgcolor, sky.type, sky.textures)
end
ps = {} ps = {}
end end
@ -139,7 +136,8 @@ lightning.strike = function(pos)
local name = player:get_player_name() local name = player:get_player_name()
if ps[name] == nil then if ps[name] == nil then
ps[name] = {p = player, sky = sky} ps[name] = {p = player, sky = sky}
player:set_sky(0xffffff, "plain", {}) skycolor.add_layer("lightning", {{r=255,g=255,b=255}})
skycolor.active = true
end end
end end

View File

@ -122,12 +122,15 @@ minetest.register_globalstep(function(dtime)
end end
-- Apply black sky in the Void and deal Void damage -- Apply black sky in the Void and deal Void damage
--[[ DISABLED because of conflicts with weater_pack.
TODO: The sky color handling needs a major rework.
if pos.y < mcl_vars.bedrock_overworld_max then if pos.y < mcl_vars.bedrock_overworld_max then
-- Player reached the void, set black sky box -- Player reached the void, set black sky box
player:set_sky("#000000", "plain") player:set_sky("#000000", "plain")
else else
player:set_sky(nil, "regular") player:set_sky(nil, "regular")
end end
]]
if pos.y < mcl_vars.bedrock_overworld_min - 65 then if pos.y < mcl_vars.bedrock_overworld_min - 65 then
-- Player is deep into the void, deal void damage -- Player is deep into the void, deal void damage
if player:get_hp() > 0 then if player:get_hp() > 0 then