Merge branch 'master' into gflib

This commit is contained in:
PikalaxALT
2019-09-27 09:11:22 -04:00
217 changed files with 5479 additions and 5086 deletions
+23 -23
View File
@@ -2989,11 +2989,11 @@ u16 MonTryLearningNewMove(struct Pokemon *mon, bool8 firstMove)
void DeleteFirstMoveAndGiveMoveToMon(struct Pokemon *mon, u16 move)
{
s32 i;
u16 moves[4];
u8 pp[4];
u16 moves[MAX_MON_MOVES];
u8 pp[MAX_MON_MOVES];
u8 ppBonuses;
for (i = 0; i < 3; i++)
for (i = 0; i < MAX_MON_MOVES - 1; i++)
{
moves[i] = GetMonData(mon, MON_DATA_MOVE2 + i, NULL);
pp[i] = GetMonData(mon, MON_DATA_PP2 + i, NULL);
@@ -3016,11 +3016,11 @@ void DeleteFirstMoveAndGiveMoveToMon(struct Pokemon *mon, u16 move)
void DeleteFirstMoveAndGiveMoveToBoxMon(struct BoxPokemon *boxMon, u16 move)
{
s32 i;
u16 moves[4];
u8 pp[4];
u16 moves[MAX_MON_MOVES];
u8 pp[MAX_MON_MOVES];
u8 ppBonuses;
for (i = 0; i < 3; i++)
for (i = 0; i < MAX_MON_MOVES - 1; i++)
{
moves[i] = GetBoxMonData(boxMon, MON_DATA_MOVE2 + i, NULL);
pp[i] = GetBoxMonData(boxMon, MON_DATA_PP2 + i, NULL);
@@ -3304,21 +3304,21 @@ u8 CountAliveMonsInBattle(u8 caseId)
switch (caseId)
{
case BATTLE_ALIVE_EXCEPT_ACTIVE:
for (i = 0; i < 4; i++)
for (i = 0; i < MAX_BATTLERS_COUNT; i++)
{
if (i != gActiveBattler && !(gAbsentBattlerFlags & gBitTable[i]))
retVal++;
}
break;
case BATTLE_ALIVE_ATK_SIDE:
for (i = 0; i < 4; i++)
for (i = 0; i < MAX_BATTLERS_COUNT; i++)
{
if (GetBattlerSide(i) == GetBattlerSide(gBattlerAttacker) && !(gAbsentBattlerFlags & gBitTable[i]))
retVal++;
}
break;
case BATTLE_ALIVE_DEF_SIDE:
for (i = 0; i < 4; i++)
for (i = 0; i < MAX_BATTLERS_COUNT; i++)
{
if (GetBattlerSide(i) == GetBattlerSide(gBattlerTarget) && !(gAbsentBattlerFlags & gBitTable[i]))
retVal++;
@@ -4329,7 +4329,7 @@ u8 SendMonToPC(struct Pokemon* mon)
{
s32 boxNo, boxPos;
set_unknown_box_id(VarGet(VAR_STORAGE_UNKNOWN));
SetPCBoxToSendMon(VarGet(VAR_PC_BOX_TO_SEND_MON));
boxNo = StorageGetCurrentBox();
@@ -4344,9 +4344,9 @@ u8 SendMonToPC(struct Pokemon* mon)
CopyMon(checkingMon, &mon->box, sizeof(mon->box));
gSpecialVar_MonBoxId = boxNo;
gSpecialVar_MonBoxPos = boxPos;
if (get_unknown_box_id() != boxNo)
FlagClear(FLAG_SYS_STORAGE_UNKNOWN_FLAG);
VarSet(VAR_STORAGE_UNKNOWN, boxNo);
if (GetPCBoxToSendMon() != boxNo)
FlagClear(FLAG_SHOWN_BOX_WAS_FULL_MESSAGE);
VarSet(VAR_PC_BOX_TO_SEND_MON, boxNo);
return MON_GIVEN_TO_PC;
}
}
@@ -4817,11 +4817,11 @@ bool8 PokemonUseItemEffects(struct Pokemon *mon, u16 item, u8 partyIndex, u8 mov
{
if (evCount >= MAX_TOTAL_EVS)
return TRUE;
if (dataSigned >= 100)
if (dataSigned >= EV_ITEM_RAISE_LIMIT)
break;
if (dataSigned + r2 > 100)
r5 = 100 - (dataSigned + r2) + r2;
if (dataSigned + r2 > EV_ITEM_RAISE_LIMIT)
r5 = EV_ITEM_RAISE_LIMIT - (dataSigned + r2) + r2;
else
r5 = r2;
@@ -5021,11 +5021,11 @@ bool8 PokemonUseItemEffects(struct Pokemon *mon, u16 item, u8 partyIndex, u8 mov
{
if (evCount >= MAX_TOTAL_EVS)
return TRUE;
if (dataSigned >= 100)
if (dataSigned >= EV_ITEM_RAISE_LIMIT)
break;
if (dataSigned + r2 > 100)
r5 = 100 - (dataSigned + r2) + r2;
if (dataSigned + r2 > EV_ITEM_RAISE_LIMIT)
r5 = EV_ITEM_RAISE_LIMIT - (dataSigned + r2) + r2;
else
r5 = r2;
@@ -6096,7 +6096,7 @@ u32 CanSpeciesLearnTMHM(u16 species, u8 tm)
u8 GetMoveRelearnerMoves(struct Pokemon *mon, u16 *moves)
{
u16 learnedMoves[4];
u16 learnedMoves[MAX_MON_MOVES];
u8 numMoves = 0;
u16 species = GetMonData(mon, MON_DATA_SPECIES, 0);
u8 level = GetMonData(mon, MON_DATA_LEVEL, 0);
@@ -6146,7 +6146,7 @@ u8 GetLevelUpMovesBySpecies(u16 species, u16 *moves)
u8 GetNumberOfRelearnableMoves(struct Pokemon *mon)
{
u16 learnedMoves[4];
u16 learnedMoves[MAX_MON_MOVES];
u16 moves[20];
u8 numMoves = 0;
u16 species = GetMonData(mon, MON_DATA_SPECIES2, 0);
@@ -6683,7 +6683,7 @@ u8 sub_806EF08(u8 arg0)
var = (arg0 != 0) ? 2 : 0;
break;
}
for (i = 0; i < 4; i++)
for (i = 0; i < MAX_LINK_PLAYERS; i++)
{
if (gLinkPlayers[i].id == (s16)(var))
break;
@@ -6706,7 +6706,7 @@ u8 sub_806EF84(u8 arg0, u8 arg1)
var = (arg0 != 0) ? 2 : 0;
break;
}
for (i = 0; i < 4; i++)
for (i = 0; i < MAX_LINK_PLAYERS; i++)
{
if (gLinkPlayers[i].id == (s16)(var))
break;