diff options
author | sphericalice <sphericalice@outlook.com> | 2022-01-04 13:46:46 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-04 13:46:46 +0000 |
commit | 48bf1ab98dc5e540b9674b087be25548c292d3f7 (patch) | |
tree | c38f3e563c9eb067b796a202f456a792113f7932 /src | |
parent | ac474892165bb454d7c1be085982a357069f43a3 (diff) |
Use SPECIES_NONE and ITEM_NONE in battle_tower.c
Diffstat (limited to 'src')
-rw-r--r-- | src/battle_tower.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/battle_tower.c b/src/battle_tower.c index d1c95285b..b747a3dc0 100644 --- a/src/battle_tower.c +++ b/src/battle_tower.c @@ -1006,7 +1006,7 @@ static bool8 ChooseSpecialBattleTowerTrainer(void) validMons = 0; for (j = 0; j < MAX_FRONTIER_PARTY_SIZE; j++) { - if (gSaveBlock2Ptr->frontier.towerRecords[i].party[j].species != 0 + if (gSaveBlock2Ptr->frontier.towerRecords[i].party[j].species != SPECIES_NONE && gSaveBlock2Ptr->frontier.towerRecords[i].party[j].level <= GetFrontierEnemyMonLevel(lvlMode)) validMons++; } @@ -1664,7 +1664,7 @@ static void FillTrainerParty(u16 trainerId, u8 firstMonId, u8 monCount) // Record mixed player. for (j = 0, i = firstMonId; i < firstMonId + monCount; j++, i++) { - if (gSaveBlock2Ptr->frontier.towerRecords[trainerId - TRAINER_RECORD_MIXING_FRIEND].party[j].species != 0 + if (gSaveBlock2Ptr->frontier.towerRecords[trainerId - TRAINER_RECORD_MIXING_FRIEND].party[j].species != SPECIES_NONE && gSaveBlock2Ptr->frontier.towerRecords[trainerId - TRAINER_RECORD_MIXING_FRIEND].party[j].level <= level) { CreateBattleTowerMon_HandleLevel(&gEnemyParty[i], &gSaveBlock2Ptr->frontier.towerRecords[trainerId - TRAINER_RECORD_MIXING_FRIEND].party[j], FALSE); @@ -1706,7 +1706,7 @@ static void FillTrainerParty(u16 trainerId, u8 firstMonId, u8 monCount) // Ensure this Pokemon's held item isn't a duplicate. for (j = 0; j < i + firstMonId; j++) { - if (GetMonData(&gEnemyParty[j], MON_DATA_HELD_ITEM, NULL) != 0 + if (GetMonData(&gEnemyParty[j], MON_DATA_HELD_ITEM, NULL) != ITEM_NONE && GetMonData(&gEnemyParty[j], MON_DATA_HELD_ITEM, NULL) == gBattleFrontierHeldItems[gFacilityTrainerMons[monId].itemTableId]) break; } @@ -2244,7 +2244,7 @@ static void GetRecordMixFriendMultiPartnerParty(u16 trainerId) if (gSaveBlock2Ptr->frontier.towerRecords[trainerId - TRAINER_RECORD_MIXING_FRIEND].party[i].species != species1 && gSaveBlock2Ptr->frontier.towerRecords[trainerId - TRAINER_RECORD_MIXING_FRIEND].party[i].species != species2 && gSaveBlock2Ptr->frontier.towerRecords[trainerId - TRAINER_RECORD_MIXING_FRIEND].party[i].level <= GetFrontierEnemyMonLevel(lvlMode) - && gSaveBlock2Ptr->frontier.towerRecords[trainerId - TRAINER_RECORD_MIXING_FRIEND].party[i].species != 0) + && gSaveBlock2Ptr->frontier.towerRecords[trainerId - TRAINER_RECORD_MIXING_FRIEND].party[i].species != SPECIES_NONE) { validSpecies[count] = i; count++; @@ -2383,7 +2383,7 @@ static void LoadMultiPartnerCandidatesData(void) if (species1 != gSaveBlock2Ptr->frontier.towerRecords[i].party[j].species && species2 != gSaveBlock2Ptr->frontier.towerRecords[i].party[j].species && gSaveBlock2Ptr->frontier.towerRecords[i].party[j].level <= GetFrontierEnemyMonLevel(lvlMode) - && gSaveBlock2Ptr->frontier.towerRecords[i].party[j].species != 0) + && gSaveBlock2Ptr->frontier.towerRecords[i].party[j].species != SPECIES_NONE) { k++; } @@ -3410,7 +3410,7 @@ static void FillTentTrainerParty_(u16 trainerId, u8 firstMonId, u8 monCount) // Ensure this Pokemon's held item isn't a duplicate. for (j = 0; j < i + firstMonId; j++) { - if (GetMonData(&gEnemyParty[j], MON_DATA_HELD_ITEM, NULL) != 0 + if (GetMonData(&gEnemyParty[j], MON_DATA_HELD_ITEM, NULL) != ITEM_NONE && GetMonData(&gEnemyParty[j], MON_DATA_HELD_ITEM, NULL) == gBattleFrontierHeldItems[gFacilityTrainerMons[monId].itemTableId]) break; } |