From df8b06dec6b999aa3901787ec664899b5e6f7074 Mon Sep 17 00:00:00 2001 From: peter1138 Date: Fri, 20 Oct 2006 19:48:25 +0000 Subject: (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... --- strings.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'strings.c') diff --git a/strings.c b/strings.c index 7e20c2c01..ead83f84f 100644 --- a/strings.c +++ b/strings.c @@ -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; } -- cgit v1.2.3-54-g00ecf