From 5d291317e786a52ccec7cd0756da19d0e15c4b4b Mon Sep 17 00:00:00 2001 From: frosch Date: Fri, 14 Mar 2025 14:03:04 +0100 Subject: [PATCH] Codechange: Two very different functions were named RemapNewGRFStringControlCode. --- src/newgrf_text.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/newgrf_text.cpp b/src/newgrf_text.cpp index d448019dba..7c314f954b 100644 --- a/src/newgrf_text.cpp +++ b/src/newgrf_text.cpp @@ -758,7 +758,7 @@ static void HandleNewGRFStringControlCodes(const char *str, TextRefStack &stack, * @param stack The TextRefStack. * @param[out] params Output parameters */ -static void RemapNewGRFStringControlCode(char32_t scc, const char **str, TextRefStack &stack, std::vector ¶ms) +static void ProcessNewGRFStringControlCode(char32_t scc, const char *&str, TextRefStack &stack, std::vector ¶ms) { /* There is data on the NewGRF text stack, and we want to move them to OpenTTD's string stack. * After this call, a new call is made with `modify_parameters` set to false when the string is finally formatted. */ @@ -797,7 +797,7 @@ static void RemapNewGRFStringControlCode(char32_t scc, const char **str, TextRef case SCC_NEWGRF_DISCARD_WORD: stack.PopUnsignedWord(); break; case SCC_NEWGRF_ROTATE_TOP_4_WORDS: stack.RotateTop4Words(); break; - case SCC_NEWGRF_PUSH_WORD: stack.PushWord(Utf8Consume(str)); break; + case SCC_NEWGRF_PUSH_WORD: stack.PushWord(Utf8Consume(&str)); break; case SCC_NEWGRF_PRINT_WORD_CARGO_LONG: case SCC_NEWGRF_PRINT_WORD_CARGO_SHORT: @@ -921,7 +921,7 @@ static void HandleNewGRFStringControlCodes(const char *str, TextRefStack &stack, for (const char *p = str; *p != '\0'; /* nothing */) { char32_t scc; p += Utf8Decode(&scc, p); - RemapNewGRFStringControlCode(scc, &p, stack, params); + ProcessNewGRFStringControlCode(scc, p, stack, params); } }