newgrf_text.c
changeset 4624 378f5dfcd7a7
parent 4504 3d20af4bd525
child 4710 a663b32b9f96
equal deleted inserted replaced
4623:c407a6d3c09f 4624:378f5dfcd7a7
   202 StringID AddGRFString(uint32 grfid, uint16 stringid, byte langid_to_add, bool new_scheme, const char *text_to_add, StringID def_string)
   202 StringID AddGRFString(uint32 grfid, uint16 stringid, byte langid_to_add, bool new_scheme, const char *text_to_add, StringID def_string)
   203 {
   203 {
   204 	GRFText *newtext;
   204 	GRFText *newtext;
   205 	uint id;
   205 	uint id;
   206 
   206 
   207 	/* We do not allow strings of only one char or even fewer*/
       
   208 	if (strlen(text_to_add) <= 1) return STR_EMPTY;
       
   209 
       
   210 	/* When working with the old language scheme (grf_version is less than 7) and
   207 	/* When working with the old language scheme (grf_version is less than 7) and
   211 	 * English or American is among the set bits, simply add it as English in
   208 	 * English or American is among the set bits, simply add it as English in
   212 	 * the new scheme, i.e. as langid = 1.
   209 	 * the new scheme, i.e. as langid = 1.
   213 	 * If English is set, it is pretty safe to assume the translations are not
   210 	 * If English is set, it is pretty safe to assume the translations are not
   214 	 * actually translated.
   211 	 * actually translated.