From 5868c2756ae8cebe15a4b37b32d4e8f25b16bf3c Mon Sep 17 00:00:00 2001 From: Hedara Date: Sun, 5 Jan 2025 10:14:10 +0100 Subject: [PATCH] Fixed shiny object events --- src/event_object_movement.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/src/event_object_movement.c b/src/event_object_movement.c index 0645d7073a..85c8af0be0 100644 --- a/src/event_object_movement.c +++ b/src/event_object_movement.c @@ -1668,7 +1668,13 @@ static u8 TrySetupObjectEventSprite(const struct ObjectEventTemplate *objectEven return OBJECT_EVENTS_COUNT; objectEvent = &gObjectEvents[objectEventId]; + if (objectEvent->graphicsId >= OBJ_EVENT_GFX_MON_BASE + SPECIES_SHINY_TAG) + { + objectEvent->shiny = TRUE; + objectEvent->graphicsId -= SPECIES_SHINY_TAG; + } graphicsInfo = GetObjectEventGraphicsInfo(objectEvent->graphicsId); + if (spriteTemplate->paletteTag != TAG_NONE && spriteTemplate->paletteTag != OBJ_EVENT_PAL_TAG_DYNAMIC) LoadObjectEventPalette(spriteTemplate->paletteTag); @@ -1678,18 +1684,6 @@ static u8 TrySetupObjectEventSprite(const struct ObjectEventTemplate *objectEven if (OW_GFX_COMPRESS) spriteTemplate->tileTag = LoadSheetGraphicsInfo(graphicsInfo, objectEvent->graphicsId, NULL); - if (objectEvent->graphicsId >= OBJ_EVENT_GFX_MON_BASE + SPECIES_SHINY_TAG) - { - objectEvent->shiny = TRUE; - objectEvent->graphicsId -= SPECIES_SHINY_TAG; - } - - if (objectEvent->graphicsId >= OBJ_EVENT_GFX_MON_BASE + SPECIES_SHINY_TAG) - { - objectEvent->shiny = TRUE; - objectEvent->graphicsId -= SPECIES_SHINY_TAG; - } - spriteId = CreateSprite(spriteTemplate, 0, 0, 0); if (spriteId == MAX_SPRITES) {