Fixed bug where decor icons cleared dynamic palettes in the Frontier Exchange Corner shop.

This commit is contained in:
Ariel A 2022-03-15 18:53:06 -04:00
parent 2273a61b37
commit c78736c94f
2 changed files with 3 additions and 1 deletions

View file

@ -25,6 +25,7 @@ void FieldEffectScript_LoadTiles(u8 **script);
void FieldEffectScript_LoadFadedPalette(u8 **script);
void FieldEffectScript_LoadPalette(u8 **script);
void FieldEffectScript_CallNative(u8 **script, u32 *val);
void FieldEffectFreeGraphicsResources(struct Sprite *sprite);
void FieldEffectFreeTilesIfUnused(u16 tileStart);
void FieldEffectFreePaletteIfUnused(u8 paletteNum);
bool8 FieldEffectCmd_loadtiles(u8 **script, u32 *val);

View file

@ -3118,7 +3118,8 @@ static void HideFrontierExchangeCornerItemIcon(u16 menu, u16 unused)
case SCROLL_MULTI_BF_EXCHANGE_CORNER_DECOR_VENDOR_2:
case SCROLL_MULTI_BF_EXCHANGE_CORNER_VITAMIN_VENDOR:
case SCROLL_MULTI_BF_EXCHANGE_CORNER_HOLD_ITEM_VENDOR:
DestroySpriteAndFreeResources(&gSprites[sScrollableMultichoice_ItemSpriteId]);
// This makes sure deleting the icon will not clear palettes in use by object events
FieldEffectFreeGraphicsResources(&gSprites[sScrollableMultichoice_ItemSpriteId]);
break;
}
sScrollableMultichoice_ItemSpriteId = MAX_SPRITES;