summaryrefslogtreecommitdiff
path: root/disaster_cmd.c
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2006-08-16 11:39:55 +0000
committerrubidium <rubidium@openttd.org>2006-08-16 11:39:55 +0000
commit3cab5f30c06035034bcf5b513c2eee57b8ec11e9 (patch)
tree90102c4cf1f03e52dfe00d3cd1315b6cd9e6b399 /disaster_cmd.c
parent50e96f8ff92bad28741ca3d360a4e7366072748d (diff)
downloadopenttd-3cab5f30c06035034bcf5b513c2eee57b8ec11e9.tar.xz
(svn r5926) -Codechange: make _cur_year contain the full year, instead of the offset since 1920
-Codechange: store all year related variables that are _not_ stored in a savegame/transported over the network in the same format as _cur_year
Diffstat (limited to 'disaster_cmd.c')
-rw-r--r--disaster_cmd.c25
1 files changed, 11 insertions, 14 deletions
diff --git a/disaster_cmd.c b/disaster_cmd.c
index 80d938ccd..3d4c58275 100644
--- a/disaster_cmd.c
+++ b/disaster_cmd.c
@@ -951,33 +951,30 @@ static DisasterInitProc * const _disaster_initprocs[] = {
Disaster7_Init,
};
-#define MK(a, b) { (a) - BASE_YEAR, (b) - BASE_YEAR }
static const struct {
- byte min;
- byte max;
+ Year min;
+ Year max;
} _dis_years[] = {
- MK(1930, 1955),
- MK(1940, 1970),
- MK(1960, 1990),
- MK(1970, 2000),
- MK(2000, 2100),
- MK(1940, 1965),
- MK(1975, 2010),
- MK(1950, 1985)
+ { 1930, 1955 },
+ { 1940, 1970 },
+ { 1960, 1990 },
+ { 1970, 2000 },
+ { 2000, 2100 },
+ { 1940, 1965 },
+ { 1975, 2010 },
+ { 1950, 1985 }
};
-#undef MK
static void DoDisaster(void)
{
byte buf[lengthof(_dis_years)];
- byte year = _cur_year;
uint i;
uint j;
j = 0;
for (i = 0; i != lengthof(_dis_years); i++) {
- if (year >= _dis_years[i].min && year < _dis_years[i].max) buf[j++] = i;
+ if (_cur_year >= _dis_years[i].min && _cur_year < _dis_years[i].max) buf[j++] = i;
}
if (j == 0) return;