(svn r6858) - Fix (r6855): Handle rail vehicles with no capacity (N/A) by setting cargo type to CT_INVALID and handling it later. STR_8838_N_A is not a valid cargo type...

This commit is contained in:
peter1138
2006-10-20 19:48:25 +00:00
parent af89d9333b
commit 53f8e99169
3 changed files with 11 additions and 8 deletions

View File

@@ -731,7 +731,8 @@ static char *FormatString(char *buff, const char *str, const int32 *argv, uint c
// Layout now is:
// 8bit - cargo type
// 16-bit - cargo count
StringID cargo_str = _cargoc.names_long[GetInt32(&argv)];
CargoID cargo = GetInt32(&argv);
StringID cargo_str = (cargo == CT_INVALID) ? STR_8838_N_A : _cargoc.names_long[cargo];
buff = GetStringWithArgs(buff, cargo_str, argv++);
break;
}