diff options
author | PikalaxALT <pikalaxalt@gmail.com> | 2021-05-06 12:47:21 -0400 |
---|---|---|
committer | PikalaxALT <pikalaxalt@gmail.com> | 2021-05-06 12:47:21 -0400 |
commit | 2fb82d4eca7cfaf9a1150b166bc1cbab7a27a5bc (patch) | |
tree | 8c3b8126aca1940f6884f8d0f75c13d50abe1537 | |
parent | d0f3c277a7bd68e9c2a44efed04d9c0cdbb64355 (diff) | |
parent | bfce7b67edc5630137f953ba00f6825d279ecd0a (diff) |
Merge remote-tracking branch 'origin/master' into trainer_tower_to_c
-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; |