diff options
-rw-r--r-- | src/newgrf_engine.cpp | 2 |
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 |