Fixes gen3 Style Shadows out of place (#5880)

This commit is contained in:
Alex 2024-12-29 12:54:33 +01:00 committed by GitHub
parent dccf2632b2
commit 445ba32679
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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)
{
@ -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;
@ -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