summaryrefslogtreecommitdiff
path: root/src/newgrf_railtype.cpp
diff options
context:
space:
mode:
authoryexo <yexo@openttd.org>2010-06-20 19:13:02 +0000
committeryexo <yexo@openttd.org>2010-06-20 19:13:02 +0000
commit9cfb61adf58f882f03f17da05e84c25f7572be6d (patch)
treeeeff74805ecd5cdd0a0869ee5dab36d34492a883 /src/newgrf_railtype.cpp
parentf2d6bf6b584e22932fc2e7778aa2d57c033ab62a (diff)
downloadopenttd-9cfb61adf58f882f03f17da05e84c25f7572be6d.tar.xz
(svn r20003) -Feature [FS#3886]: [NewGRF] var 43 depot build date for railtypes
Diffstat (limited to 'src/newgrf_railtype.cpp')
-rw-r--r--src/newgrf_railtype.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/newgrf_railtype.cpp b/src/newgrf_railtype.cpp
index 4a40d6605..53894dca7 100644
--- a/src/newgrf_railtype.cpp
+++ b/src/newgrf_railtype.cpp
@@ -15,6 +15,9 @@
#include "newgrf_railtype.h"
#include "newgrf_spritegroup.h"
#include "core/bitmath_func.hpp"
+#include "date_func.h"
+#include "depot_base.h"
+#include "rail_map.h"
static uint32 RailTypeGetRandomBits(const ResolverObject *object)
{
@@ -41,6 +44,7 @@ static uint32 RailTypeGetVariable(const ResolverObject *object, byte variable, b
case 0x40: return 0;
case 0x41: return 0;
case 0x42: return 0;
+ case 0x43: return _date;
}
}
@@ -48,6 +52,9 @@ static uint32 RailTypeGetVariable(const ResolverObject *object, byte variable, b
case 0x40: return GetTerrainType(tile);
case 0x41: return 0;
case 0x42: return IsLevelCrossingTile(tile) && IsCrossingBarred(tile);
+ case 0x43:
+ if (IsRailDepotTile(tile)) return Depot::GetByTile(tile)->build_date;
+ return _date;
}
DEBUG(grf, 1, "Unhandled rail type tile property 0x%X", variable);