summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoryexo <yexo@openttd.org>2010-03-01 19:53:28 +0000
committeryexo <yexo@openttd.org>2010-03-01 19:53:28 +0000
commitfe5bb036a063d73b05bd15f5b6797e7c637e11ef (patch)
treed5aade06f2e1962360e76032b3ff81e952482324 /src
parent5152cb1a2639d2c8270e4b4a6c7cf84b7dcd9c97 (diff)
downloadopenttd-fe5bb036a063d73b05bd15f5b6797e7c637e11ef.tar.xz
(svn r19298) -Fix: [NewGRF] segfault when station vars 0xF2/0xF3 is accessed when there is no truck/bus stop
Diffstat (limited to 'src')
-rw-r--r--src/newgrf_station.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/newgrf_station.cpp b/src/newgrf_station.cpp
index 52c7c1edb..26361f3fd 100644
--- a/src/newgrf_station.cpp
+++ b/src/newgrf_station.cpp
@@ -525,8 +525,8 @@ uint32 Station::GetNewGRFVariable(const ResolverObject *object, byte variable, b
case 0x8A: return this->had_vehicle_of_type;
case 0xF1: return this->airport_type;
- case 0xF2: return this->truck_stops->status;
- case 0xF3: return this->bus_stops->status;
+ case 0xF2: return (this->truck_stops != NULL) ? this->truck_stops->status : 0;
+ case 0xF3: return (this->bus_stops != NULL) ? this->bus_stops->status : 0;
case 0xF6: return this->airport_flags;
case 0xF7: return GB(this->airport_flags, 8, 8);
}