diff options
author | Kurausukun <lord.uber1@gmail.com> | 2021-05-04 00:49:51 -0400 |
---|---|---|
committer | Kurausukun <lord.uber1@gmail.com> | 2021-05-04 00:49:51 -0400 |
commit | ca7134316d9478e14d3d4216078d166d0f12d036 (patch) | |
tree | ccc8ffcc41bc3ca216f78dd34840fd6373fc6870 /src | |
parent | 9ed87063f1682488a809f95dd578dec37d916aad (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 4cc39e8aa..1df525967 100644 --- a/src/battle_interface.c +++ b/src/battle_interface.c @@ -736,18 +736,11 @@ static void UpdateLvlInHealthbox(u8 healthboxSpriteId, u8 lvl) u32 windowId, spriteTileNum; u8 *windowTileData; u8 text[16] = _("{LV_2}"); - u32 xPos, var1; - void *objVram; + u32 xPos; + u8 *objVram; - 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, &windowId); spriteTileNum = gSprites[healthboxSpriteId].oam.tileNum * TILE_SIZE_4BPP; |