summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2005-09-20 17:33:57 +0000
committerpeter1138 <peter1138@openttd.org>2005-09-20 17:33:57 +0000
commit75be0ed773b9839c96c19fbd05a3d744b8ab3f6e (patch)
tree58a79016fe6b363434463332a69940280c6b89dd
parent316944c1f5ae2ae6fd4ca574da25cdfbf324aceb (diff)
downloadopenttd-75be0ed773b9839c96c19fbd05a3d744b8ab3f6e.tar.xz
(svn r2966) Fix: newgrf: Replace special case with a check for the existence of a handler in VehicleChangeInfo.
-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;
}