summaryrefslogtreecommitdiff
path: root/src/newgrf_railtype.cpp
diff options
context:
space:
mode:
authormichi_cc <michi_cc@openttd.org>2010-07-16 19:02:59 +0000
committermichi_cc <michi_cc@openttd.org>2010-07-16 19:02:59 +0000
commit2a3ec78d9f35ad788dcaeab306f355d2e496c16d (patch)
tree07ff22d827fc7f060fda77149fda3b9afc979bd0 /src/newgrf_railtype.cpp
parente809c05099b09bab8f23a4307e0088247478770c (diff)
downloadopenttd-2a3ec78d9f35ad788dcaeab306f355d2e496c16d.tar.xz
(svn r20165) -Feature: [NewGRF] Information (var 4A) about the current railtype a train is on.
Diffstat (limited to 'src/newgrf_railtype.cpp')
-rw-r--r--src/newgrf_railtype.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/newgrf_railtype.cpp b/src/newgrf_railtype.cpp
index 114f31b7c..a0d66ec03 100644
--- a/src/newgrf_railtype.cpp
+++ b/src/newgrf_railtype.cpp
@@ -110,7 +110,7 @@ SpriteID GetCustomRailSprite(const RailtypeInfo *rti, TileIndex tile, RailTypeSp
uint8 GetReverseRailTypeTranslation(RailType railtype, const GRFFile *grffile)
{
/* No rail type table present, return rail type as-is */
- if (grffile->railtype_max == 0) return railtype;
+ if (grffile == NULL || grffile->railtype_max == 0) return railtype;
/* Look for a matching rail type label in the table */
RailTypeLabel label = GetRailTypeInfo(railtype)->label;