Merge pull request #1655 from GriffinRichards/fix-berry-id

Fix math in CreateBerrySprite
This commit is contained in:
GriffinR 2022-05-12 18:04:30 -04:00 committed by GitHub
commit 1842af7570
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1188,9 +1188,9 @@ static void SetBerrySpriteData(struct Sprite* sprite, s16 x, s16 y, s16 bounceSp
#undef sXSpeed
#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],
sBerrySpriteData[playerId][0],
sBerrySpriteData[playerId][1],