summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2011-09-19 19:22:18 +0000
committerfrosch <frosch@openttd.org>2011-09-19 19:22:18 +0000
commit427dd736ae2bc3f2ae0ea07c1b50fd7252883e05 (patch)
tree5ceca97d729dca6e4747e1402f38254e2e9a10c7
parent64dc7f5ee83e0e5642f668c793911145d93dc95d (diff)
downloadopenttd-427dd736ae2bc3f2ae0ea07c1b50fd7252883e05.tar.xz
(svn r22946) -Fix [FS#4781]: [NewGRF] Crash when accessing vehicle var 44 for a non-front aircraft.
-rw-r--r--src/newgrf_engine.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/newgrf_engine.cpp b/src/newgrf_engine.cpp
index f69142a25..6e0ce75ec 100644
--- a/src/newgrf_engine.cpp
+++ b/src/newgrf_engine.cpp
@@ -596,7 +596,7 @@ static uint32 VehicleGetVariable(const ResolverObject *object, byte variable, by
return v->grf_cache.company_information;
case 0x44: // Aircraft information
- if (v->type != VEH_AIRCRAFT) return UINT_MAX;
+ if (v->type != VEH_AIRCRAFT || !Aircraft::From(v)->IsNormalAircraft()) return UINT_MAX;
{
const Vehicle *w = v->Next();