summaryrefslogtreecommitdiff
path: root/src/field_specials.c
diff options
context:
space:
mode:
authorgarak <garakmon@gmail.com>2018-11-27 13:31:07 -0500
committergarak <garakmon@gmail.com>2018-11-27 13:31:07 -0500
commit50f00b0827a4952a12f90009bd992f23c80a56af (patch)
tree6a5f78b04b42c162ed95cfc66c91a8b24f4051b2 /src/field_specials.c
parentf02cb667bbddf4f4a1152c86cbf9616468e7f0d2 (diff)
parentc909aa92dee0a8d202d9195d80d0cc96b0d1ebc8 (diff)
Merge remote-tracking branch 'upstream/master' into fldeff
Diffstat (limited to 'src/field_specials.c')
-rw-r--r--src/field_specials.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/field_specials.c b/src/field_specials.c
index 113f46922..562127890 100644
--- a/src/field_specials.c
+++ b/src/field_specials.c
@@ -2052,26 +2052,26 @@ _08139D7C:\n\
void sub_8139D98(void)
{
u8 i;
- u32 ivStorage[6];
+ u32 ivStorage[NUM_STATS];
- ivStorage[0] = GetMonData(&gPlayerParty[gSpecialVar_0x8004], MON_DATA_HP_IV);
- ivStorage[1] = GetMonData(&gPlayerParty[gSpecialVar_0x8004], MON_DATA_ATK_IV);
- ivStorage[2] = GetMonData(&gPlayerParty[gSpecialVar_0x8004], MON_DATA_DEF_IV);
- ivStorage[3] = GetMonData(&gPlayerParty[gSpecialVar_0x8004], MON_DATA_SPEED_IV);
- ivStorage[4] = GetMonData(&gPlayerParty[gSpecialVar_0x8004], MON_DATA_SPATK_IV);
- ivStorage[5] = GetMonData(&gPlayerParty[gSpecialVar_0x8004], MON_DATA_SPDEF_IV);
+ ivStorage[STAT_HP] = GetMonData(&gPlayerParty[gSpecialVar_0x8004], MON_DATA_HP_IV);
+ ivStorage[STAT_ATK] = GetMonData(&gPlayerParty[gSpecialVar_0x8004], MON_DATA_ATK_IV);
+ ivStorage[STAT_DEF] = GetMonData(&gPlayerParty[gSpecialVar_0x8004], MON_DATA_DEF_IV);
+ ivStorage[STAT_SPEED] = GetMonData(&gPlayerParty[gSpecialVar_0x8004], MON_DATA_SPEED_IV);
+ ivStorage[STAT_SPATK] = GetMonData(&gPlayerParty[gSpecialVar_0x8004], MON_DATA_SPATK_IV);
+ ivStorage[STAT_SPDEF] = GetMonData(&gPlayerParty[gSpecialVar_0x8004], MON_DATA_SPDEF_IV);
gSpecialVar_0x8005 = 0;
- for (i = 0; i < ARRAY_COUNT(ivStorage); i++)
+ for (i = 0; i < NUM_STATS; i++)
{
gSpecialVar_0x8005 += ivStorage[i];
}
gSpecialVar_0x8006 = 0;
- gSpecialVar_0x8007 = ivStorage[0]; // HP IV
+ gSpecialVar_0x8007 = ivStorage[STAT_HP];
- for (i = 1; i < 6; i++)
+ for (i = 1; i < NUM_STATS; i++)
{
if (ivStorage[gSpecialVar_0x8006] < ivStorage[i])
{
@@ -2081,7 +2081,7 @@ void sub_8139D98(void)
else if (ivStorage[gSpecialVar_0x8006] == ivStorage[i])
{
u16 randomNumber = Random();
- if ((randomNumber & 1) != 0)
+ if (randomNumber & 1)
{
gSpecialVar_0x8006 = i;
gSpecialVar_0x8007 = ivStorage[i];