From 5676cc32b4269a3aa5f00bf361df679ed63083ce Mon Sep 17 00:00:00 2001 From: peter1138 Date: Tue, 20 Sep 2005 17:33:57 +0000 Subject: (svn r2966) Fix: newgrf: Replace special case with a check for the existence of a handler in VehicleChangeInfo. --- newgrf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } -- cgit v1.2.3-70-g09d2