summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--newgrf.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/newgrf.c b/newgrf.c
index 901d84df2..7956e8549 100644
--- a/newgrf.c
+++ b/newgrf.c
@@ -1041,7 +1041,7 @@ static void VehicleChangeInfo(byte *buf, int len)
DEBUG(grf, 6) ("VehicleChangeInfo: Feature %d, %d properties, to apply to %d+%d",
feature, numprops, engine, numinfo);
- if (feature > GSF_STATION) {
+ if (feature >= lengthof(handler) || handler[feature] == NULL) {
grfmsg(GMS_WARN, "VehicleChangeInfo: Unsupported feature %d, skipping.", feature);
return;
}