Skip to content

Commit

Permalink
Fixes gen3 Style Shadows out of place (#5880)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexOn1ine authored Dec 29, 2024
1 parent dccf263 commit 445ba32
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/battle_gfx_sfx_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -1185,7 +1185,7 @@ void CreateEnemyShadowSprite(u32 battler)
{
gBattleSpritesDataPtr->healthBoxesData[battler].shadowSpriteIdPrimary = CreateSprite(&gSpriteTemplate_EnemyShadow,
GetBattlerSpriteCoord(battler, BATTLER_COORD_X),
GetBattlerSpriteCoord(battler, BATTLER_COORD_Y),
GetBattlerSpriteCoord(battler, BATTLER_COORD_Y) + 29,
0xC8);
if (gBattleSpritesDataPtr->healthBoxesData[battler].shadowSpriteIdPrimary < MAX_SPRITES)
{
Expand Down Expand Up @@ -1247,9 +1247,11 @@ void SpriteCB_EnemyShadow(struct Sprite *shadowSprite)
return;
}

s8 xOffset = 0, yOffset = 0, size = SHADOW_SIZE_S;
s8 xOffset = 0, UNUSED yOffset = 0, size = SHADOW_SIZE_S;
if (gAnimScriptActive || battlerSprite->invisible)
{
invisible = TRUE;
}
else if (transformSpecies != SPECIES_NONE)
{
xOffset = gSpeciesInfo[transformSpecies].enemyShadowXOffset;
Expand All @@ -1267,21 +1269,19 @@ void SpriteCB_EnemyShadow(struct Sprite *shadowSprite)
yOffset = gSpeciesInfo[species].enemyShadowYOffset + 16;
size = gSpeciesInfo[species].enemyShadowSize;
}
else
{
yOffset = 29;
}

if (gBattleSpritesDataPtr->battlerData[battler].behindSubstitute)
invisible = TRUE;

shadowSprite->x = battlerSprite->x + xOffset;
shadowSprite->x2 = battlerSprite->x2;
shadowSprite->y = battlerSprite->y + yOffset;
shadowSprite->invisible = invisible;

if (B_ENEMY_MON_SHADOW_STYLE >= GEN_4 && P_GBA_STYLE_SPECIES_GFX == FALSE)
{
shadowSprite->oam.tileNum = shadowSprite->tBaseTileNum + (8 * size);
shadowSprite->y = battlerSprite->y + yOffset;
}
}

#undef tBattlerId
Expand Down

0 comments on commit 445ba32

Please sign in to comment.