From 4d9208ea0cd91991b58ae0ba975e0c366c01c53f Mon Sep 17 00:00:00 2001 From: AZero13 Date: Wed, 26 Aug 2026 06:25:47 -0400 Subject: [PATCH] Fix TextIntoHealthboxObject fakematch (#2329) --- src/battle_interface.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/battle_interface.c b/src/battle_interface.c index 6b814c53ff..da816f59a3 100644 --- a/src/battle_interface.c +++ b/src/battle_interface.c @@ -2584,16 +2584,14 @@ static void HpTextIntoHealthboxObject(void *dest, u8 *windowTileData, u32 window static void TextIntoHealthboxObject(void *dest, u8 *windowTileData, s32 windowWidth) { + int i; CpuCopy32(windowTileData + 256, dest + 256, windowWidth * TILE_SIZE_4BPP); -// + 256 as that prevents the top 4 blank rows of sHealthboxWindowTemplate from being copied - if (windowWidth > 0) + // + 256 as that prevents the top 4 blank rows of sHealthboxWindowTemplate from being copied + for (i = 0; i < windowWidth; i++) { - do - { - CpuCopy32(windowTileData + 20, dest + 20, 12); - dest += 32, windowTileData += 32; - windowWidth--; - } while (windowWidth != 0); + CpuCopy32(windowTileData + 20, dest + 20, 12); + dest += 32; + windowTileData += 32; } }