Skip to content

Commit

Permalink
Use cached "weather" setting
Browse files Browse the repository at this point in the history
  • Loading branch information
proller committed Sep 16, 2013
1 parent 62bc533 commit cfe6eaa
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/game.cpp
Expand Up @@ -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)
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit cfe6eaa

Please sign in to comment.