(svn r19713) -Fix [NewGRF]: passing some invalid data to industry variable 67/68 could cause a crash

replace/41b28d7194a279bdc17475d4fbe2ea6ec885a466
rubidium 14 years ago
parent 03c6f51c84
commit 82136fbc62

@ -131,6 +131,9 @@ static uint32 GetCountAndDistanceOfClosestInstance(byte param_setID, byte layout
break;
}
/* If the industry type is invalid, there is none and the closest is far away. */
if (ind_index >= NUM_INDUSTRYTYPES) return 0 | 0xFFFF;
if (layout_filter == 0) {
/* If the filter is 0, it could be because none was specified as well as being really a 0.
* In either case, just do the regular var67 */

Loading…
Cancel
Save