(svn r9371) -Feature: Add support for variable snow lines in the arctic climate, supplied
by newgrf files. When this is enabled forests cannot be built below the highest snow line, and farms can't be built above it. Houses still use the _opt.snow_line so they are all consistent, so to make them respect the snowline you may want to use some newhouses features as well.
This commit is contained in:
@@ -27,6 +27,7 @@
|
||||
#include "fontcache.h"
|
||||
#include "date.h"
|
||||
#include "currency.h"
|
||||
#include "landscape.h"
|
||||
#include "sound.h"
|
||||
#include "newgrf_config.h"
|
||||
#include "newgrf_house.h"
|
||||
@@ -1510,6 +1511,22 @@ static bool GlobalVarChangeInfo(uint gvid, int numinfo, int prop, byte **bufp, i
|
||||
break;
|
||||
|
||||
case 0x10: // 12 * 32 * B Snow line height table
|
||||
if (numinfo > 1 || IsSnowLineSet()) {
|
||||
grfmsg(1, "GlobalVarChangeInfo: The snowline can only be set once (%d)", numinfo);
|
||||
} else if (len < SNOW_LINE_MONTHS * SNOW_LINE_DAYS) {
|
||||
grfmsg(1, "GlobalVarChangeInfo: Not enough entries set in the snowline table (%d)", len);
|
||||
} else {
|
||||
byte table[SNOW_LINE_MONTHS][SNOW_LINE_DAYS];
|
||||
|
||||
for (uint i = 0; i < SNOW_LINE_MONTHS; i++) {
|
||||
for (uint j = 0; j < SNOW_LINE_DAYS; j++) {
|
||||
table[i][j] = grf_load_byte(&buf);
|
||||
}
|
||||
}
|
||||
SetSnowLine(table);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
ret = true;
|
||||
}
|
||||
@@ -3973,6 +3990,9 @@ static void ResetNewGRFData()
|
||||
ResetStationClasses();
|
||||
ResetCustomStations();
|
||||
|
||||
/* Reset the snowline table. */
|
||||
ClearSnowLine();
|
||||
|
||||
/* Reset NewGRF files */
|
||||
ResetNewGRF();
|
||||
|
||||
|
Reference in New Issue
Block a user