fix player palette after hall of fame

This commit is contained in:
cawtds
2024-07-21 15:01:29 +02:00
parent cb94efc976
commit 0862865c96
2 changed files with 2 additions and 3 deletions

View File

@@ -111,7 +111,7 @@ struct __attribute__((packed, aligned(4))) ObjectEventTemplate
{
/*0x00*/ u8 localId;
/*0x01*/ u16 graphicsId;
/*0x03*/ u8 kind; // Always OBJ_KIND_NORMAL in Emerald.
/*0x03*/ u8 kind; // The "kind" field determines how to access objUnion union below.
/*0x04*/ s16 x;
/*0x06*/ s16 y;
union {

View File

@@ -2796,7 +2796,6 @@ static u8 UpdateSpritePalette(const struct SpritePalette *spritePalette, struct
FieldEffectFreePaletteIfUnused(sprite->oam.paletteNum);
sprite->inUse = TRUE;
sprite->oam.paletteNum = LoadSpritePalette(spritePalette);
ApplyGlobalFieldPaletteTint(sprite->oam.paletteNum);
return sprite->oam.paletteNum;
}
@@ -2814,7 +2813,7 @@ static void ObjectEventSetGraphics(struct ObjectEvent *objectEvent, const struct
{
struct Sprite *sprite = &gSprites[objectEvent->spriteId];
u32 i = FindObjectEventPaletteIndexByTag(graphicsInfo->paletteTag);
if (i != 0xFF)
if (i != 0xFF && graphicsInfo->paletteSlot != PALSLOT_PLAYER)
UpdateSpritePalette(&sObjectEventSpritePalettes[i], sprite);
// If gfx size changes, we need to reallocate tiles