diff options
author | Kurausukun <lord.uber1@gmail.com> | 2021-05-03 18:22:44 -0400 |
---|---|---|
committer | huderlem <huderlem@gmail.com> | 2021-05-13 11:26:15 -0500 |
commit | fa23b196a96e58eaa14d996ac88a3e9b1f274a84 (patch) | |
tree | 0920f862d897bd2d5441f177af20dbf3214dfe9f /src | |
parent | dfd87e09f95910c6ce3b0b9d955e179d6d65951f (diff) |
[LEAK-INFORMED] fix battle_interface fakematch
Diffstat (limited to 'src')
-rw-r--r-- | src/battle_interface.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/src/battle_interface.c b/src/battle_interface.c index 5518fd21b..b309d62b0 100644 --- a/src/battle_interface.c +++ b/src/battle_interface.c @@ -1099,21 +1099,14 @@ static void UpdateLvlInHealthbox(u8 healthboxSpriteId, u8 lvl) u32 windowId, spriteTileNum; u8 *windowTileData; u8 text[16]; - u32 xPos, var1; - void *objVram; + u32 xPos; + u8 *objVram; text[0] = 0xF9; text[1] = 5; - xPos = (u32) ConvertIntToDecimalStringN(text + 2, lvl, STR_CONV_MODE_LEFT_ALIGN, 3); - // Alright, that part was unmatchable. It's basically doing: - // xPos = 5 * (3 - (u32)(&text[2])); - xPos--; - xPos--; - xPos -= ((u32)(text)); - var1 = (3 - xPos); - xPos = 4 * var1; - xPos += var1; + objVram = ConvertIntToDecimalStringN(text + 2, lvl, STR_CONV_MODE_LEFT_ALIGN, 3); + xPos = 5 * (3 - (objVram - (text + 2))); windowTileData = AddTextPrinterAndCreateWindowOnHealthbox(text, xPos, 3, 2, &windowId); spriteTileNum = gSprites[healthboxSpriteId].oam.tileNum * TILE_SIZE_4BPP; |