Fix math in CreateBerrySprite

This commit is contained in:
GriffinR 2022-04-26 21:44:11 -04:00
parent ef4d99c87e
commit 2b223acd87

View File

@ -1188,9 +1188,9 @@ static void SetBerrySpriteData(struct Sprite* sprite, s16 x, s16 y, s16 bounceSp
#undef sXSpeed #undef sXSpeed
#undef sYDownSpeed #undef sYDownSpeed
static void CreateBerrySprite(u16 a0, u8 playerId) static void CreateBerrySprite(u16 itemId, u8 playerId)
{ {
u8 spriteId = CreateSpinningBerrySprite(a0 + FIRST_BERRY_INDEX - 10, 0, 80, playerId & 1); u8 spriteId = CreateSpinningBerrySprite(ITEM_TO_BERRY(itemId) - 1, 0, 80, playerId & 1);
SetBerrySpriteData(&gSprites[spriteId], SetBerrySpriteData(&gSprites[spriteId],
sBerrySpriteData[playerId][0], sBerrySpriteData[playerId][0],
sBerrySpriteData[playerId][1], sBerrySpriteData[playerId][1],