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
commit5676cc32b4269a3aa5f00bf361df679ed63083ce (patch)
tree58a79016fe6b363434463332a69940280c6b89dd
parent2f0616e9f2c821830a8533fd7bde0c1660604215 (diff)
downloadopenttd-5676cc32b4269a3aa5f00bf361df679ed63083ce.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;
}