aboutsummaryrefslogtreecommitdiff
path: root/src/environment.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/environment.cpp')
-rw-r--r--src/environment.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/environment.cpp b/src/environment.cpp
index 5249dd9ec..aea3afeaa 100644
--- a/src/environment.cpp
+++ b/src/environment.cpp
@@ -49,7 +49,9 @@ Environment::Environment():
m_time_of_day(9000),
m_time_of_day_f(9000./24000),
m_time_of_day_speed(0),
- m_time_counter(0)
+ m_time_counter(0),
+ m_enable_day_night_ratio_override(false),
+ m_day_night_ratio_override(0.0f)
{
}
@@ -190,6 +192,8 @@ std::list<Player*> Environment::getPlayers(bool ignore_disconnected)
u32 Environment::getDayNightRatio()
{
+ if(m_enable_day_night_ratio_override)
+ return m_day_night_ratio_override;
bool smooth = g_settings->getBool("enable_shaders");
return time_to_daynight_ratio(m_time_of_day_f*24000, smooth);
}