From 9c67ec3cdf8f1260f0911564c2e3b1a0d7e832fd Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Sun, 20 Mar 2022 11:20:22 -0300 Subject: [PATCH] Fixed icons showing when there's no encounters in the map --- src/dexnav.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dexnav.c b/src/dexnav.c index 635df0e9ab..c4323f6a9d 100644 --- a/src/dexnav.c +++ b/src/dexnav.c @@ -1997,7 +1997,7 @@ static void DexNavLoadEncounterData(void) static void TryDrawIconInSlot(u16 species, s16 x, s16 y) { - if (species == SPECIES_NONE) + if (species == SPECIES_NONE || species > NUM_SPECIES) CreateNoDataIcon(x, y); //'X' in slot else if (!GetSetPokedexFlag(SpeciesToNationalPokedexNum(species), FLAG_GET_SEEN)) CreateMonIcon(SPECIES_NONE, SpriteCB_MonIcon, x, y, 0, 0xFFFFFFFF, 0); //question mark @@ -2035,7 +2035,7 @@ static void DrawSpeciesIcons(void) y = ROW_HIDDEN_ICON_Y; if (FlagGet(FLAG_SYS_DETECTOR_MODE)) TryDrawIconInSlot(species, x, y); - else if (species == SPECIES_NONE) + else if (species == SPECIES_NONE || species > NUM_SPECIES) CreateNoDataIcon(x, y); else CreateMonIcon(SPECIES_NONE, SpriteCB_MonIcon, x, y, 0, 0xFFFFFFFF, 0); //question mark if detector mode inactive