From 2184cdc32cf81dec0b254615d4e6043217f4b50e Mon Sep 17 00:00:00 2001 From: cawtds <38510667+cawtds@users.noreply.github.com> Date: Wed, 11 Mar 2026 22:52:21 +0100 Subject: [PATCH] fix newline getting emitted at the end of a string --- src/battle_message.c | 2 +- src/line_break.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/battle_message.c b/src/battle_message.c index ec10c33dd..48c2debff 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -3717,7 +3717,7 @@ u32 BattleStringExpandPlaceholders(const u8 *src, u8 *dst, u32 dstSize) while (*toCpy != EOS) { if (*toCpy == CHAR_SPACE) - dst[dstID] = CHAR_SPACE; // TODO: NBSP fails tests + dst[dstID] = CHAR_NBSP; else dst[dstID] = *toCpy; dstID++; diff --git a/src/line_break.c b/src/line_break.c index bb601a0d7..29bf235e5 100644 --- a/src/line_break.c +++ b/src/line_break.c @@ -295,7 +295,7 @@ void BreakSubStringAutomatic(u8 *src, u32 maxWidth, u32 screenLines, u8 fontId, currWordIndex++; while (currWordIndex < numWords) { - if (currLineWidth + spaceWidth + allWords[currWordIndex].width > maxWidth) + if (currLineWidth + spaceWidth + allWords[currWordIndex].width + ((toggleScrollPrompt == SHOW_SCROLL_PROMPT) ? SCROLL_PROMPT_WIDTH : 0) > maxWidth) { // go to next line currLineIndex++;