newgrf_text.c
changeset 4504 3d20af4bd525
parent 4305 c25b05028b71
child 4624 378f5dfcd7a7
equal deleted inserted replaced
4503:70d61e331efa 4504:3d20af4bd525
   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 
   207 	/* When working with the old language scheme (grf_version is less than 7) and
   210 	/* When working with the old language scheme (grf_version is less than 7) and
   208 	 * English or American is among the set bits, simply add it as English in
   211 	 * English or American is among the set bits, simply add it as English in
   209 	 * the new scheme, i.e. as langid = 1.
   212 	 * the new scheme, i.e. as langid = 1.
   210 	 * If English is set, it is pretty safe to assume the translations are not
   213 	 * If English is set, it is pretty safe to assume the translations are not
   211 	 * actually translated.
   214 	 * actually translated.