From b6d142f481a8d242b5429df7316cbf813b3ab3f1 Mon Sep 17 00:00:00 2001 From: Pavol Marko Date: Thu, 19 Aug 2004 19:34:49 +0000 Subject: [PATCH] Lang strings can now contain ^n (newline), ^t (tabulator) and ^^ (^). --- amxmodx/CLang.cpp | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/amxmodx/CLang.cpp b/amxmodx/CLang.cpp index 15385f34..3211f6a5 100755 --- a/amxmodx/CLang.cpp +++ b/amxmodx/CLang.cpp @@ -695,7 +695,29 @@ char * CLangMngr::FormatAmxString(AMX *amx, cell *params, int parm, int &len) } outptr += strlen(outptr); } - *outptr++ = *def++; + else if (*def == '^') + { + ++def; + switch (*def) + { + case 'n': + *outptr++ = '\n'; + break; + case 't': + *outptr++ = '\t'; + break; + case '^': + *outptr++ = '^'; + break; + default: + *outptr++ = '^'; + *outptr++ = *def; + break; + } + ++def; + } + else + *outptr++ = *def++; } } else