Cache current value of snow line height

This commit is contained in:
Jonathan G Rennison
2021-02-21 22:02:58 +00:00
parent f595696e97
commit 2e20da40ed
6 changed files with 29 additions and 2 deletions

View File

@@ -21,6 +21,7 @@
#include "newgrf_profiling.h"
#include "console_func.h"
#include "debug.h"
#include "landscape.h"
#include "widgets/statusbar_widget.h"
#include "safeguards.h"
@@ -54,6 +55,7 @@ void SetDate(Date date, DateFract fract)
ConvertDateToYMD(date, &ymd);
_cur_date_ymd = ymd;
SetScaledTickVariables();
UpdateCachedSnowLine();
}
void SetScaledTickVariables()
@@ -322,6 +324,8 @@ void IncreaseDate()
/* update internal variables before calling the daily/monthly/yearly loops */
_cur_date_ymd = ymd;
UpdateCachedSnowLine();
/* yes, call various daily loops */
OnNewDay();