aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorproller <proller@github.com>2013-09-17 02:56:15 +0400
committerproller <proller@github.com>2013-09-17 02:57:36 +0400
commitcfe6eaa66ba44e1f4cedcd91fd730a5b520eb437 (patch)
treec6cef0df3469ca20467d082f14c9a2a4026137b8
parent62bc5331aad4e2c7cd64d57feb9cf27526842851 (diff)
downloadminetest-cfe6eaa66ba44e1f4cedcd91fd730a5b520eb437.tar.gz
minetest-cfe6eaa66ba44e1f4cedcd91fd730a5b520eb437.tar.bz2
minetest-cfe6eaa66ba44e1f4cedcd91fd730a5b520eb437.zip
Use cached "weather" setting
-rw-r--r--src/game.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/game.cpp b/src/game.cpp
index b9ffcb7cf..851f5dd9d 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -1456,6 +1456,8 @@ void the_game(
Hud hud(driver, guienv, font, text_height,
gamedef, player, &local_inventory);
+ bool use_weather = g_settings->getBool("weather");
+
for(;;)
{
if(device->run() == false || kill == true)
@@ -2860,7 +2862,7 @@ void the_game(
fog_range = 100000*BS;
else {
fog_range = draw_control.wanted_range*BS + 0.0*MAP_BLOCKSIZE*BS;
- if(g_settings->getBool("weather"))
+ if(use_weather)
fog_range *= (1.5 - 1.4*(float)client.getEnv().getClientMap().getHumidity(pos_i)/100);
fog_range = MYMIN(fog_range, (draw_control.farthest_drawn+20)*BS);
fog_range *= 0.9;