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 ttl = 1
local revertsky = function()
local revertsky = function(dtime)
if ttl == 0 then
return
end
ttl = ttl - 1
ttl = ttl - dtime
if ttl > 0 then
return
end
for key, entry in pairs(ps) do
local sky = entry.sky
entry.p:set_sky(sky.bgcolor, sky.type, sky.textures)
end
skycolor.remove_layer("lightning")
ps = {}
end
@ -139,7 +136,8 @@ lightning.strike = function(pos)
local name = player:get_player_name()
if ps[name] == nil then
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