Fix bug with female icon sprites
Thanks to AsparagusEduardo for this code!
This commit is contained in:
parent
dc5259ed3f
commit
7610a9abad
1 changed files with 11 additions and 5 deletions
|
@ -5145,14 +5145,20 @@ static u16 TryLoadMonIconTiles(u16 species, u32 personality)
|
||||||
static void RemoveSpeciesFromIconList(u16 species)
|
static void RemoveSpeciesFromIconList(u16 species)
|
||||||
{
|
{
|
||||||
u16 i;
|
u16 i;
|
||||||
|
bool8 hasFemale = FALSE;
|
||||||
|
|
||||||
for (i = 0; i < MAX_MON_ICONS; i++)
|
for (i = 0; i < MAX_MON_ICONS; i++)
|
||||||
{
|
{
|
||||||
/* This is flawed - if a male mon with gender differeneces has its icon removed from the list,
|
if (sStorage->iconSpeciesList[i] == (species | 0x8000))
|
||||||
* but a female mon of the same species is still visible, its icon will also be cleared from the list.
|
{
|
||||||
* This may create a small but noticable visual bug when switching boxes.
|
hasFemale = TRUE;
|
||||||
*/
|
break;
|
||||||
if (sStorage->iconSpeciesList[i] == species || sStorage->iconSpeciesList[i] == (species | 0x8000))
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (i = 0; i < MAX_MON_ICONS; i++)
|
||||||
|
{
|
||||||
|
if (sStorage->iconSpeciesList[i] == species && !hasFemale)
|
||||||
{
|
{
|
||||||
if (--sStorage->numIconsPerSpecies[i] == 0)
|
if (--sStorage->numIconsPerSpecies[i] == 0)
|
||||||
sStorage->iconSpeciesList[i] = SPECIES_NONE;
|
sStorage->iconSpeciesList[i] = SPECIES_NONE;
|
||||||
|
|
Loading…
Reference in a new issue