Use trainer constants in flags, automatically update flags/vars count

This commit is contained in:
GriffinR
2021-01-29 15:37:52 -05:00
parent 419c897292
commit 1f6dc0e86b
88 changed files with 929 additions and 945 deletions
+6 -8
View File
@@ -25,11 +25,9 @@
#include "field_specials.h"
#include "constants/items.h"
#include "constants/item_effects.h"
#include "constants/species.h"
#include "constants/hoenn_cries.h"
#include "constants/pokemon.h"
#include "constants/abilities.h"
#include "constants/flags.h"
#include "constants/moves.h"
#include "constants/songs.h"
#include "constants/trainer_classes.h"
@@ -5020,10 +5018,10 @@ static u16 HoennPokedexNumToSpecies(u16 var)
species = 0;
while (species < POKEMON_SLOTS_NUMBER - 1 && sSpeciesToHoennPokedexNum[species] != var)
while (species < NUM_SPECIES - 1 && sSpeciesToHoennPokedexNum[species] != var)
species++;
if (species == POKEMON_SLOTS_NUMBER - 1)
if (species == NUM_SPECIES - 1)
return 0;
return species + 1;
@@ -5038,10 +5036,10 @@ u16 NationalPokedexNumToSpecies(u16 nationalNum)
species = 0;
while (species < POKEMON_SLOTS_NUMBER - 1 && sSpeciesToNationalPokedexNum[species] != nationalNum)
while (species < NUM_SPECIES - 1 && sSpeciesToNationalPokedexNum[species] != nationalNum)
species++;
if (species == POKEMON_SLOTS_NUMBER - 1)
if (species == NUM_SPECIES - 1)
return 0;
return species + 1;
@@ -5056,10 +5054,10 @@ static u16 NationalToHoennOrder(u16 nationalNum)
hoennNum = 0;
while (hoennNum < POKEMON_SLOTS_NUMBER - 1 && sHoennToNationalOrder[hoennNum] != nationalNum)
while (hoennNum < NUM_SPECIES - 1 && sHoennToNationalOrder[hoennNum] != nationalNum)
hoennNum++;
if (hoennNum == POKEMON_SLOTS_NUMBER - 1)
if (hoennNum == NUM_SPECIES - 1)
return 0;
return hoennNum + 1;