diff --git a/include/config/overworld.h b/include/config/overworld.h index ca2fd3fe55..4ceeae91c1 100644 --- a/include/config/overworld.h +++ b/include/config/overworld.h @@ -80,6 +80,7 @@ // Lighting #define OW_SHADOW_INTENSITY 4 // Ranges from 0 to 16, where 0 is fully transparent and 16 is black. +#define OW_OBJECT_SUBPRIORITY 148 // The higher the value, the farther back compared to other sprites. Shadows should be behind object events. // Overworld flags // To use the following features in scripting, replace the 0s with the flag ID you're assigning it to. diff --git a/src/field_effect_helpers.c b/src/field_effect_helpers.c index cd23ea5bac..9f8324aee6 100644 --- a/src/field_effect_helpers.c +++ b/src/field_effect_helpers.c @@ -347,7 +347,7 @@ u32 FldEff_Shadow(void) if (graphicsInfo->shadowSize == SHADOW_SIZE_NONE) // don't create a shadow at all return 0; LoadSpriteSheetByTemplate(gFieldEffectObjectTemplatePointers[sShadowEffectTemplateIds[graphicsInfo->shadowSize]], 0); - spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[sShadowEffectTemplateIds[graphicsInfo->shadowSize]], 0, 0, 0x94 + 1); // higher = farther back; shadows should be behind object events + spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[sShadowEffectTemplateIds[graphicsInfo->shadowSize]], 0, 0, OW_OBJECT_SUBPRIORITY + 1); if (spriteId != MAX_SPRITES) { // SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(8, 12)); diff --git a/src/rotating_gate.c b/src/rotating_gate.c index 796c64cecb..7ff04b508f 100644 --- a/src/rotating_gate.c +++ b/src/rotating_gate.c @@ -740,7 +740,7 @@ static u8 RotatingGate_CreateGate(u8 gateId, s16 deltaX, s16 deltaY) template.tileTag = gate->shape + ROTATING_GATE_TILE_TAG; - spriteId = CreateSprite(&template, 0, 0, 0x93); // 0x93 is above shadows (0x94) + spriteId = CreateSprite(&template, 0, 0, OW_OBJECT_SUBPRIORITY - 1); // Above shadows if (spriteId == MAX_SPRITES) return MAX_SPRITES;