Tweak night vision conditions
This commit is contained in:
parent
3bdd95fe47
commit
1816324fe5
|
@ -55,9 +55,13 @@ mcl_weather.skycolor = {
|
||||||
-- Wrapper for updating day/night ratio that respects night vision
|
-- Wrapper for updating day/night ratio that respects night vision
|
||||||
override_day_night_ratio = function(player, ratio)
|
override_day_night_ratio = function(player, ratio)
|
||||||
local meta = player:get_meta()
|
local meta = player:get_meta()
|
||||||
local night_vision = meta:get_int("night_vision")
|
local has_night_vision = meta:get_int("night_vision") == 1
|
||||||
local arg
|
local arg
|
||||||
if night_vision == 1 then
|
-- Apply night vision only for dark sky
|
||||||
|
local is_dark = minetest.get_timeofday() > 0.8 or minetest.get_timeofday() < 0.2 or mcl_weather.state ~= "none"
|
||||||
|
local pos = player:get_pos()
|
||||||
|
local dim = mcl_worlds.pos_to_dimension(pos)
|
||||||
|
if has_night_vision and is_dark and dim ~= "nether" and dim ~= "end" then
|
||||||
if ratio == nil then
|
if ratio == nil then
|
||||||
arg = NIGHT_VISION_RATIO
|
arg = NIGHT_VISION_RATIO
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue