From 41b414bc1c45d46ab6c227ab0a67a876f0faa3c8 Mon Sep 17 00:00:00 2001 From: glx22 Date: Sat, 18 Feb 2023 14:37:52 +0100 Subject: [PATCH] Change: [Script] Restore support of {RAW_STRING} in ScriptText --- src/strings.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/strings.cpp b/src/strings.cpp index f888770714..2f39a39991 100644 --- a/src/strings.cpp +++ b/src/strings.cpp @@ -926,8 +926,9 @@ static char *FormatString(char *buff, const char *str_arg, StringParameters *arg sub_args.SetParam(i++, param); } else { + s++; // skip the leading \" char *g = stredup(s); - g[p - s] = '\0'; + g[p - s - 1] = '\0'; // skip the trailing \" sub_args_need_free[i] = true; sub_args.SetParam(i++, (uint64)(size_t)g); @@ -1044,7 +1045,6 @@ static char *FormatString(char *buff, const char *str_arg, StringParameters *arg break; case SCC_RAW_STRING_POINTER: { // {RAW_STRING} - if (game_script) break; const char *raw_string = (const char *)(size_t)args->GetInt64(SCC_RAW_STRING_POINTER); buff = FormatString(buff, raw_string, args, last); break;