Fix HGSS dex sort orders working incorrectly (#5790)

This commit is contained in:
RavePossum 2024-12-15 09:10:42 -05:00 committed by GitHub
parent a669c4c109
commit beeca545aa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2560,11 +2560,11 @@ static void CreatePokedexList(u8 dexMode, u8 order)
}
break;
case ORDER_ALPHABETICAL:
for (i = 0; i < NUM_SPECIES - 1; i++)
for (i = 0; i < NATIONAL_DEX_COUNT; i++)
{
temp_dexNum = gPokedexOrder_Alphabetical[i];
if (NationalToHoennOrder(temp_dexNum) <= temp_dexCount && GetSetPokedexFlag(temp_dexNum, FLAG_GET_SEEN))
if ((!temp_isHoennDex || NationalToHoennOrder(temp_dexNum) != 0) && GetSetPokedexFlag(temp_dexNum, FLAG_GET_SEEN))
{
sPokedexView->pokedexList[sPokedexView->pokemonListCount].dexNum = temp_dexNum;
sPokedexView->pokedexList[sPokedexView->pokemonListCount].seen = TRUE;
@ -2578,7 +2578,7 @@ static void CreatePokedexList(u8 dexMode, u8 order)
{
temp_dexNum = gPokedexOrder_Weight[i];
if (NationalToHoennOrder(temp_dexNum) <= temp_dexCount && GetSetPokedexFlag(temp_dexNum, FLAG_GET_CAUGHT))
if ((!temp_isHoennDex || NationalToHoennOrder(temp_dexNum) != 0) && GetSetPokedexFlag(temp_dexNum, FLAG_GET_CAUGHT))
{
sPokedexView->pokedexList[sPokedexView->pokemonListCount].dexNum = temp_dexNum;
sPokedexView->pokedexList[sPokedexView->pokemonListCount].seen = TRUE;
@ -2592,7 +2592,7 @@ static void CreatePokedexList(u8 dexMode, u8 order)
{
temp_dexNum = gPokedexOrder_Weight[i];
if (NationalToHoennOrder(temp_dexNum) <= temp_dexCount && GetSetPokedexFlag(temp_dexNum, FLAG_GET_CAUGHT))
if ((!temp_isHoennDex || NationalToHoennOrder(temp_dexNum) != 0) && GetSetPokedexFlag(temp_dexNum, FLAG_GET_CAUGHT))
{
sPokedexView->pokedexList[sPokedexView->pokemonListCount].dexNum = temp_dexNum;
sPokedexView->pokedexList[sPokedexView->pokemonListCount].seen = TRUE;
@ -2606,7 +2606,7 @@ static void CreatePokedexList(u8 dexMode, u8 order)
{
temp_dexNum = gPokedexOrder_Height[i];
if (NationalToHoennOrder(temp_dexNum) <= temp_dexCount && GetSetPokedexFlag(temp_dexNum, FLAG_GET_CAUGHT))
if ((!temp_isHoennDex || NationalToHoennOrder(temp_dexNum) != 0) && GetSetPokedexFlag(temp_dexNum, FLAG_GET_CAUGHT))
{
sPokedexView->pokedexList[sPokedexView->pokemonListCount].dexNum = temp_dexNum;
sPokedexView->pokedexList[sPokedexView->pokemonListCount].seen = TRUE;
@ -2620,7 +2620,7 @@ static void CreatePokedexList(u8 dexMode, u8 order)
{
temp_dexNum = gPokedexOrder_Height[i];
if (NationalToHoennOrder(temp_dexNum) <= temp_dexCount && GetSetPokedexFlag(temp_dexNum, FLAG_GET_CAUGHT))
if ((!temp_isHoennDex || NationalToHoennOrder(temp_dexNum) != 0) && GetSetPokedexFlag(temp_dexNum, FLAG_GET_CAUGHT))
{
sPokedexView->pokedexList[sPokedexView->pokemonListCount].dexNum = temp_dexNum;
sPokedexView->pokedexList[sPokedexView->pokemonListCount].seen = TRUE;