summaryrefslogtreecommitdiff
path: root/newgrf_station.c
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2006-08-20 20:21:00 +0000
committerrubidium <rubidium@openttd.org>2006-08-20 20:21:00 +0000
commit2d30e02ba27fcffb16293f47a2404ddf24b8afc7 (patch)
tree26c60f6e35de8b3a260791f8f2d26f28cc379528 /newgrf_station.c
parentb1e2ae44d6564709c0947319849a4928f0d0f949 (diff)
downloadopenttd-2d30e02ba27fcffb16293f47a2404ddf24b8afc7.tar.xz
(svn r6013) -Fix: some newgrf properties returned the date in the new format where the newgrf's expect the original format. Thanks to michi_cc for finding these and providing the initial patch.
Diffstat (limited to 'newgrf_station.c')
-rw-r--r--newgrf_station.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/newgrf_station.c b/newgrf_station.c
index 0c602f646..548727b7d 100644
--- a/newgrf_station.c
+++ b/newgrf_station.c
@@ -325,7 +325,7 @@ static uint32 StationGetVariable(const ResolverObject *object, byte variable, by
case 0x42: return 0; /* Rail type (XXX Get current type from GUI?) */
case 0x43: return _current_player; /* Station owner */
case 0x44: return 2; /* PBS status */
- case 0xFA: return _date; /* Build date */
+ case 0xFA: return max(_date - DAYS_TILL_ORIGINAL_BASE_YEAR, 0); /* Build date */
}
*available = false;
@@ -372,7 +372,7 @@ static uint32 StationGetVariable(const ResolverObject *object, byte variable, by
case 0xF3: return st->bus_stops->status;
case 0xF6: return st->airport_flags;
case 0xF7: return st->airport_flags & 0xFF;
- case 0xFA: return st->build_date;
+ case 0xFA: return max(st->build_date - DAYS_TILL_ORIGINAL_BASE_YEAR, 0);
}
/* Handle cargo variables (deprecated) */