diff --git a/include/constants/gba/species.h b/include/constants/gba/species.h index 53207db7b8..fb4fad0339 100644 --- a/include/constants/gba/species.h +++ b/include/constants/gba/species.h @@ -1,6 +1,9 @@ #ifndef POKEPLATINUM_CONSTANTS_GBA_SPECIES_H #define POKEPLATINUM_CONSTANTS_GBA_SPECIES_H +// IDs up to 251 (Celebi) are the same as Gen 4's species. +// IDs between 252 and 276 correspond to Gen 3's SPECIES_OLD_UNOWN B to Z. + #define GBA_SPECIES_TREECKO 277 #define GBA_SPECIES_GROVYLE 278 #define GBA_SPECIES_SCEPTILE 279 diff --git a/src/overlay097/ov97_02233B18.c b/src/overlay097/ov97_02233B18.c index 3a491dea94..eeca492e8f 100644 --- a/src/overlay097/ov97_02233B18.c +++ b/src/overlay097/ov97_02233B18.c @@ -81,6 +81,9 @@ #include "overlay097/ov97_02237694.h" #include "overlay097/ov97_022392E4.h" +#include "constants/species.h" +#include "constants/gba/species.h" + FS_EXTERN_OVERLAY(overlay77); typedef struct { @@ -232,25 +235,18 @@ static int Unk_ov97_0223EAB8[] = { 0x21 }; -static BOOL IsGBASpeciesInvalid (int param0) +static BOOL IsGBASpeciesInvalid (int speciesGBA) { - if (param0 <= 0) { - return 1; - } + if (speciesGBA <= SPECIES_NONE) + return TRUE; + else if (speciesGBA <= SPECIES_CELEBI) + return FALSE; + else if (speciesGBA < GBA_SPECIES_TREECKO) + return TRUE; + else if (speciesGBA <= GBA_SPECIES_CHIMECHO) + return FALSE; - if (param0 <= 251) { - return 0; - } - - if (param0 < 277) { - return 1; - } - - if (param0 <= 411) { - return 0; - } - - return 1; + return TRUE; } static void ov97_02233B44 (UnkStruct_ov97_02234A2C * param0)