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
+7 -7
View File
@@ -1315,7 +1315,7 @@ static bool8 ExtractMonDataToSummaryStruct(struct Pokemon *a)
break;
case 1:
for (i = 0; i < 4; i++)
for (i = 0; i < MAX_MON_MOVES; i++)
{
sum->moves[i] = GetMonData(a, MON_DATA_MOVE1+i);
sum->pp[i] = GetMonData(a, MON_DATA_PP1+i);
@@ -1851,7 +1851,7 @@ static void sub_81C0F44(u8 taskId)
static bool8 sub_81C1040(void)
{
u8 i;
for (i = 1; i < 4; i++)
for (i = 1; i < MAX_MON_MOVES; i++)
{
if (pssData->summary.moves[i] != 0)
return TRUE;
@@ -1867,14 +1867,14 @@ static void sub_81C1070(s16 *a, s8 b, u8 *c)
PlaySE(SE_SELECT);
moveIndex = *c;
for (i = 0; i < 4; i++)
for (i = 0; i < MAX_MON_MOVES; i++)
{
moveIndex += b;
if (moveIndex > a[0])
moveIndex = 0;
else if (moveIndex < 0)
moveIndex = a[0];
if (moveIndex == 4)
if (moveIndex == MAX_MON_MOVES)
{
move = pssData->newMove;
break;
@@ -3548,7 +3548,7 @@ static void PrintContestMoveDescription(u8 moveSlot)
{
u16 move;
if (moveSlot == 4)
if (moveSlot == MAX_MON_MOVES)
move = pssData->newMove;
else
move = pssData->summary.moves[moveSlot];
@@ -3744,7 +3744,7 @@ static void sub_81C4420(void)
{
u8 i;
struct PokeSummary *summary = &pssData->summary;
for (i = 0; i < 4; i++)
for (i = 0; i < MAX_MON_MOVES; i++)
{
if (summary->moves[i] != MOVE_NONE)
SetMoveTypeSpritePosAndType(gBattleMoves[summary->moves[i]].type, 0x55, 0x20 + (i * 0x10), i + 3);
@@ -3757,7 +3757,7 @@ static void sub_81C4484(void)
{
u8 i;
struct PokeSummary *summary = &pssData->summary;
for (i = 0; i < 4; i++)
for (i = 0; i < MAX_MON_MOVES; i++)
{
if (summary->moves[i] != MOVE_NONE)
SetMoveTypeSpritePosAndType(NUMBER_OF_MON_TYPES + gContestMoves[summary->moves[i]].contestCategory, 0x55, 0x20 + (i * 0x10), i + 3);