From 3667feddd31eee7cf4800379f5f0d8e9e157ef7a Mon Sep 17 00:00:00 2001 From: teknomunk Date: Wed, 19 Jun 2024 08:31:56 -0500 Subject: [PATCH] Address review comments --- mods/ENVIRONMENT/mcl_weather/skycolor.lua | 2 ++ mods/ENVIRONMENT/mcl_weather/skycolor/effects.lua | 8 +++----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/mods/ENVIRONMENT/mcl_weather/skycolor.lua b/mods/ENVIRONMENT/mcl_weather/skycolor.lua index bca0d8234..9beb82b64 100644 --- a/mods/ENVIRONMENT/mcl_weather/skycolor.lua +++ b/mods/ENVIRONMENT/mcl_weather/skycolor.lua @@ -73,6 +73,8 @@ local skycolor = { -- number of colors while constructing gradient of user given colors max_val = 1000, + NIGHT_VISION_RATIO = NIGHT_VISION_RATIO, + -- Table for tracking layer order layer_names = {}, diff --git a/mods/ENVIRONMENT/mcl_weather/skycolor/effects.lua b/mods/ENVIRONMENT/mcl_weather/skycolor/effects.lua index c0a349410..9e7680ba1 100644 --- a/mods/ENVIRONMENT/mcl_weather/skycolor/effects.lua +++ b/mods/ENVIRONMENT/mcl_weather/skycolor/effects.lua @@ -3,8 +3,9 @@ local DIM_ALLOW_NIGHT_VISION = { void = true, } +local NIGHT_VISION_RATIO = mcl_weather.skycolor.NIGHT_VISION_RATIO 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) -- No darkness effect if visited by shepherd @@ -34,10 +35,7 @@ function effects_handlers.night_vision(player, meta, effect, sky_data) end local function effects(player, sky_data) - if not has_mcl_potions then - if not minetest.get_modpath("mcl_potions") then return end - has_mcl_potions = true - end + if not has_mcl_potions then return end local meta = player:get_meta() for name,effect in pairs(mcl_potions.registered_effects) do