Add bugfix to LoadObjectEventPalette
This commit is contained in:
parent
33f3a7c11a
commit
a203c03eac
1 changed files with 7 additions and 1 deletions
|
@ -1998,7 +1998,12 @@ static void LoadObjectEventPalette(u16 paletteTag)
|
|||
{
|
||||
u16 i = FindObjectEventPaletteIndexByTag(paletteTag);
|
||||
|
||||
if (i != OBJ_EVENT_PAL_TAG_NONE) // always true
|
||||
// FindObjectEventPaletteIndexByTag returns 0xFF on failure, not OBJ_EVENT_PAL_TAG_NONE.
|
||||
#ifdef BUGFIX
|
||||
if (i != 0xFF)
|
||||
#else
|
||||
if (i != OBJ_EVENT_PAL_TAG_NONE)
|
||||
#endif
|
||||
LoadSpritePaletteIfTagExists(&sObjectEventSpritePalettes[i]);
|
||||
}
|
||||
|
||||
|
@ -2021,6 +2026,7 @@ static u8 LoadSpritePaletteIfTagExists(const struct SpritePalette *spritePalette
|
|||
|
||||
void PatchObjectPalette(u16 paletteTag, u8 paletteSlot)
|
||||
{
|
||||
// paletteTag is assumed to exist in sObjectEventSpritePalettes
|
||||
u8 paletteIndex = FindObjectEventPaletteIndexByTag(paletteTag);
|
||||
|
||||
LoadPalette(sObjectEventSpritePalettes[paletteIndex].data, 16 * paletteSlot + 0x100, 0x20);
|
||||
|
|
Loading…
Reference in a new issue