Added special cases for %% and % at end of phrase for formatting of phrases defined in language definition files.
This commit is contained in:
		| @@ -584,9 +584,17 @@ char * CLangMngr::FormatAmxString(AMX *amx, cell *params, int parm, int &len) | |||||||
| 					if (*def == '%') | 					if (*def == '%') | ||||||
| 					{ | 					{ | ||||||
| 						++def; | 						++def; | ||||||
|  | 						if (*def == '%' || *def == 0) | ||||||
|  | 						{ | ||||||
|  | 							*outptr++ = '%'; | ||||||
|  | 							++def; | ||||||
|  | 						} | ||||||
|  | 						else | ||||||
|  | 						{ | ||||||
| 							static char format[32]; | 							static char format[32]; | ||||||
| 							format[0] = '%'; | 							format[0] = '%'; | ||||||
| 							char *ptr = format+1; | 							char *ptr = format+1; | ||||||
|  | 							 | ||||||
| 							while (ptr-format<sizeof(format) && !isalpha(*ptr++ = *def++)) | 							while (ptr-format<sizeof(format) && !isalpha(*ptr++ = *def++)) | ||||||
| 								/*nothing*/; | 								/*nothing*/; | ||||||
| 							ZEROTERM(format); | 							ZEROTERM(format); | ||||||
| @@ -634,6 +642,7 @@ char * CLangMngr::FormatAmxString(AMX *amx, cell *params, int parm, int &len) | |||||||
| 							} | 							} | ||||||
| 							outptr += strlen(outptr); | 							outptr += strlen(outptr); | ||||||
| 						} | 						} | ||||||
|  | 					} | ||||||
| 					else if (*def == '^') | 					else if (*def == '^') | ||||||
| 					{ | 					{ | ||||||
| 						++def; | 						++def; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user