summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2011-11-08 17:29:21 +0000
committerfrosch <frosch@openttd.org>2011-11-08 17:29:21 +0000
commit8a2342a5e6884c8079d879feecf3647fb06650a1 (patch)
tree86cff1b6122fed76ba5f7f25150567e59eac7870 /src
parentdd3e6d3e44f7fd23cb9b5c86889e36fa49d4ddfc (diff)
downloadopenttd-8a2342a5e6884c8079d879feecf3647fb06650a1.tar.xz
(svn r23156) -Change: [NewGRF] Clamp height in aircraft variable 44.
Diffstat (limited to 'src')
-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 40d931d70..f13543f08 100644
--- a/src/newgrf_engine.cpp
+++ b/src/newgrf_engine.cpp
@@ -561,7 +561,7 @@ static uint32 VehicleGetVariable(Vehicle *v, const ResolverObject *object, byte
airporttype = st->airport.GetSpec()->ttd_airport_type;
}
- return (altitude << 8) | airporttype;
+ return (Clamp(altitude, 0, 0xFF) << 8) | airporttype;
}
case 0x45: { // Curvature info