Match PrintMonWeight

This commit is contained in:
PokeCodec 2020-09-09 16:35:04 -04:00
parent 7f1827767c
commit f50ecf5c66

View File

@ -4167,21 +4167,18 @@ static void PrintMonHeight(u16 height, u8 left, u8 top)
static void PrintMonWeight(u16 weight, u8 left, u8 top)
{
#ifndef NONMATCHING
asm("":::"r9");
{
#endif
u8 buffer[16];
u8 i;
bool8 output;
u8 i = 0;
u32 lbs = (weight * 100000) / 4536;
if (lbs % 10u >= 5)
lbs += 10;
i = 0;
output = FALSE;
buffer[i] = (lbs / 100000) + CHAR_0;
if (buffer[i] == CHAR_0)
if ((buffer[i] = (lbs / 100000) + CHAR_0) == CHAR_0 && !output)
{
buffer[i++] = 0x77;
}
@ -4192,8 +4189,7 @@ static void PrintMonWeight(u16 weight, u8 left, u8 top)
}
lbs %= 100000;
buffer[i] = (lbs / 10000) + CHAR_0;
if (buffer[i] == CHAR_0 && !output)
if ((buffer[i] = (lbs / 10000) + CHAR_0) == CHAR_0 && !output)
{
buffer[i++] = 0x77;
}
@ -4204,13 +4200,13 @@ static void PrintMonWeight(u16 weight, u8 left, u8 top)
}
lbs %= 10000;
buffer[i] = (lbs / 1000) + CHAR_0;
if (buffer[i] == CHAR_0 && !output)
if ((buffer[i] = (lbs / 1000) + CHAR_0) == CHAR_0 && !output)
{
buffer[i++] = 0x77;
}
else
{
output = TRUE;
i++;
}
@ -4226,9 +4222,6 @@ static void PrintMonWeight(u16 weight, u8 left, u8 top)
buffer[i++] = CHAR_PERIOD;
buffer[i++] = EOS;
PrintInfoScreenText(buffer, left, top);
#ifndef NONMATCHING
}
#endif
}
const u8 *GetPokedexCategoryName(u16 dexNum) // unused
@ -4236,13 +4229,19 @@ const u8 *GetPokedexCategoryName(u16 dexNum) // unused
return gPokedexEntries[dexNum].categoryName;
}
enum
{
HEIGHT,
WEIGHT,
};
u16 GetPokedexHeightWeight(u16 dexNum, u8 data)
{
switch (data)
{
case 0: // height
case HEIGHT:
return gPokedexEntries[dexNum].height;
case 1: // weight
case WEIGHT:
return gPokedexEntries[dexNum].weight;
default:
return 1;