(svn r4510) - NewGRF bounds checking:

- check Engine ID is within range
  - don't try setting a vehicle name if the string id is not a valid Engine ID
This commit is contained in:
peter1138
2006-04-21 20:59:04 +00:00
parent f8b6525765
commit 0b3659b41a
2 changed files with 6 additions and 2 deletions

View File

@@ -1761,9 +1761,11 @@ static void VehicleNewName(byte *buf, int len)
case GSF_TRAIN:
case GSF_ROAD:
case GSF_SHIP:
case GSF_AIRCRAFT:
SetCustomEngineName(id, AddGRFString(_cur_grffile->grfid, id, lang, name));
case GSF_AIRCRAFT: {
StringID string = AddGRFString(_cur_grffile->grfid, id, lang, name);
if (id < TOTAL_NUM_ENGINES) SetCustomEngineName(id, string);
break;
}
#if 0
case GSF_STATION: