From 87ead2daa3cd5158ecd0d1858cb047c4feb6fefd Mon Sep 17 00:00:00 2001 From: rubidium Date: Wed, 17 Nov 2010 18:35:59 +0000 Subject: [PATCH] (svn r21224) -Fix [FS#4172]: [NewGRF] The specs' cargo strings and OpenTTD's use of the clashed. Provide properties so NewGRFs can provide cargo strings tailored for OpenTTD while retaining (some) backward compatability --- src/newgrf.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/newgrf.cpp b/src/newgrf.cpp index fca8f96bf5..d4b74045a8 100644 --- a/src/newgrf.cpp +++ b/src/newgrf.cpp @@ -2097,14 +2097,20 @@ static ChangeInfoResult CargoChangeInfo(uint cid, int numinfo, int prop, ByteRea _string_to_grf_mapping[&cs->name_single] = _cur_grffile->grfid; break; - case 0x0B: - /* String for units of cargo. This is different in OpenTTD to TTDPatch - * (e.g. 10 tonnes of coal) */ + case 0x0B: // String for singular quantity of cargo (e.g. 1 tonne of coal) + case 0x1B: // String for cargo units + /* String for units of cargo. This is different in OpenTTD + * (e.g. tonnes) to TTDPatch (e.g. {COMMA} tonne of coal). + * Property 1B is used to set OpenTTD's behaviour. */ cs->units_volume = buf->ReadWord(); _string_to_grf_mapping[&cs->units_volume] = _cur_grffile->grfid; break; - case 0x0C: // String for quantity of cargo (e.g. 10 tonnes of coal) + case 0x0C: // String for plural quantity of cargo (e.g. 10 tonnes of coal) + case 0x1C: // String for any amount of cargo + /* Strings for an amount of cargo. This is different in OpenTTD + * (e.g. {WEIGHT} of coal) to TTDPatch (e.g. {COMMA} tonnes of coal). + * Property 1C is used to set OpenTTD's behaviour. */ cs->quantifier = buf->ReadWord(); _string_to_grf_mapping[&cs->quantifier] = _cur_grffile->grfid; break;