Address review comments
This commit is contained in:
parent
dc074ff555
commit
3667feddd3
|
@ -73,6 +73,8 @@ local skycolor = {
|
||||||
-- number of colors while constructing gradient of user given colors
|
-- number of colors while constructing gradient of user given colors
|
||||||
max_val = 1000,
|
max_val = 1000,
|
||||||
|
|
||||||
|
NIGHT_VISION_RATIO = NIGHT_VISION_RATIO,
|
||||||
|
|
||||||
-- Table for tracking layer order
|
-- Table for tracking layer order
|
||||||
layer_names = {},
|
layer_names = {},
|
||||||
|
|
||||||
|
|
|
@ -3,8 +3,9 @@ local DIM_ALLOW_NIGHT_VISION = {
|
||||||
void = true,
|
void = true,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
local NIGHT_VISION_RATIO = mcl_weather.skycolor.NIGHT_VISION_RATIO
|
||||||
local effects_handlers = {}
|
local effects_handlers = {}
|
||||||
local has_mcl_potions = false
|
local has_mcl_potions = not not minetest.get_modpath("mcl_potions") -- Coerce to boolean with "not not"
|
||||||
|
|
||||||
function effects_handlers.darkness(player, meta, effect, sky_data)
|
function effects_handlers.darkness(player, meta, effect, sky_data)
|
||||||
-- No darkness effect if visited by shepherd
|
-- No darkness effect if visited by shepherd
|
||||||
|
@ -34,10 +35,7 @@ function effects_handlers.night_vision(player, meta, effect, sky_data)
|
||||||
end
|
end
|
||||||
|
|
||||||
local function effects(player, sky_data)
|
local function effects(player, sky_data)
|
||||||
if not has_mcl_potions then
|
if not has_mcl_potions then return end
|
||||||
if not minetest.get_modpath("mcl_potions") then return end
|
|
||||||
has_mcl_potions = true
|
|
||||||
end
|
|
||||||
|
|
||||||
local meta = player:get_meta()
|
local meta = player:get_meta()
|
||||||
for name,effect in pairs(mcl_potions.registered_effects) do
|
for name,effect in pairs(mcl_potions.registered_effects) do
|
||||||
|
|
Loading…
Reference in New Issue