From 2a3ec78d9f35ad788dcaeab306f355d2e496c16d Mon Sep 17 00:00:00 2001 From: michi_cc Date: Fri, 16 Jul 2010 19:02:59 +0000 Subject: (svn r20165) -Feature: [NewGRF] Information (var 4A) about the current railtype a train is on. --- src/newgrf_railtype.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/newgrf_railtype.cpp') 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; -- cgit v1.2.3-54-g00ecf