use max mon moves constant where able (#480)

* use max mon moves constant where able

* fix errors in script commands file

* fix more errors
This commit is contained in:
melthelesbian
2018-12-25 12:50:15 -05:00
committed by Marcus Huderle
parent dcbc8db6a3
commit 2dd706ca54
33 changed files with 265 additions and 260 deletions

View File

@@ -2185,15 +2185,15 @@ static void sub_81A447C(void)
u16 monId = gSaveBlock2Ptr->frontier.selectedPartyMons[i] - 1;
if (monId < PARTY_SIZE)
{
for (j = 0; j < 4; j++)
for (j = 0; j < MAX_MON_MOVES; j++)
{
for (k = 0; k < 4; k++)
for (k = 0; k < MAX_MON_MOVES; k++)
{
if (GetMonData(&gSaveBlock1Ptr->playerParty[gSaveBlock2Ptr->frontier.selectedPartyMons[i] - 1], MON_DATA_MOVE1 + k, NULL)
== GetMonData(&gPlayerParty[i], MON_DATA_MOVE1 + j, NULL))
break;
}
if (k == 4)
if (k == MAX_MON_MOVES)
SetMonMoveSlot(&gPlayerParty[i], MOVE_SKETCH, j);
}
gSaveBlock1Ptr->playerParty[gSaveBlock2Ptr->frontier.selectedPartyMons[i] - 1] = gPlayerParty[i];
@@ -2511,7 +2511,7 @@ void CreateFrontierBrainPokemon(void)
for (j = 0; j < NUM_STATS; j++)
SetMonData(&gEnemyParty[monPartyId], MON_DATA_HP_EV + j, &sFrontierBrainsMons[facility][symbol][i].evs[j]);
friendship = 0xFF;
for (j = 0; j < 4; j++)
for (j = 0; j < MAX_MON_MOVES; j++)
{
SetMonMoveSlot(&gEnemyParty[monPartyId], sFrontierBrainsMons[facility][symbol][i].moves[j], j);
if (sFrontierBrainsMons[facility][symbol][i].moves[j] == MOVE_FRUSTRATION)