mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-15 09:25:37 +02:00
Add player:override_day_night_ratio() for arbitrarily controlling sunlight brightness
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user