fix newline getting emitted at the end of a string

This commit is contained in:
cawtds 2026-03-11 22:52:21 +01:00
parent 1e5bbfe3ce
commit 2184cdc32c
2 changed files with 2 additions and 2 deletions

View File

@ -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++;

View File

@ -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++;