From 80a0f61bbbdfadbaa5f40d66678a803c3405ff11 Mon Sep 17 00:00:00 2001 From: Ariel A <24759293+aarant@users.noreply.github.com> Date: Sat, 2 Oct 2021 21:22:05 -0400 Subject: [PATCH] Fixed rotating gate palette. --- src/rotating_gate.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/rotating_gate.c b/src/rotating_gate.c index a185d9a145..a389bfc7d7 100644 --- a/src/rotating_gate.c +++ b/src/rotating_gate.c @@ -457,11 +457,12 @@ static const union AffineAnimCmd *const sSpriteAffineAnimTable_RotatingGate[] = sSpriteAffineAnim_RotatingClockwise270to360Faster, }; +#define OBJ_EVENT_PAL_TAG_NPC_1 0x1103 static const struct SpriteTemplate sSpriteTemplate_RotatingGateLarge = { .tileTag = ROTATING_GATE_TILE_TAG, - .paletteTag = 0xFFFF, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_1, .oam = &sOamData_RotatingGateLarge, .anims = sSpriteAnimTable_RotatingGateLarge, .images = NULL, @@ -472,7 +473,7 @@ static const struct SpriteTemplate sSpriteTemplate_RotatingGateLarge = static const struct SpriteTemplate sSpriteTemplate_RotatingGateRegular = { .tileTag = ROTATING_GATE_TILE_TAG, - .paletteTag = 0xFFFF, + .paletteTag = OBJ_EVENT_PAL_TAG_NPC_1, .oam = &sOamData_RotatingGateRegular, .anims = sSpriteAnimTable_RotatingGateRegular, .images = NULL, @@ -744,7 +745,7 @@ static u8 RotatingGate_CreateGate(u8 gateId, s16 deltaX, s16 deltaY) template.tileTag = gate->shape + ROTATING_GATE_TILE_TAG; - spriteId = CreateSprite(&template, 0, 0, 0x94); + spriteId = CreateSprite(&template, 0, 0, 0x93); if (spriteId == MAX_SPRITES) return MAX_SPRITES; @@ -752,6 +753,7 @@ static u8 RotatingGate_CreateGate(u8 gateId, s16 deltaX, s16 deltaY) y = gate->y + 7; sprite = &gSprites[spriteId]; + UpdateSpritePaletteByTemplate(&template, sprite); sprite->data[0] = gateId; sprite->coordOffsetEnabled = 1;