Corrected uses of GetBattlerSide

This commit is contained in:
Eduardo Quezada 2022-08-27 00:59:12 -04:00
parent 0a34d47041
commit 6c457f42af
5 changed files with 10 additions and 10 deletions

View File

@ -203,7 +203,7 @@ static void AnimMegahornHorn(struct Sprite *sprite)
gBattleAnimArgs[2] = -gBattleAnimArgs[2]; gBattleAnimArgs[2] = -gBattleAnimArgs[2];
gBattleAnimArgs[0] = -gBattleAnimArgs[0]; gBattleAnimArgs[0] = -gBattleAnimArgs[0];
} }
else if (!GetBattlerSide(gBattleAnimTarget)) else if (GetBattlerSide(gBattleAnimTarget) == B_SIDE_PLAYER)
{ {
StartSpriteAffineAnim(sprite, 1); StartSpriteAffineAnim(sprite, 1);
gBattleAnimArgs[1] = -gBattleAnimArgs[1]; gBattleAnimArgs[1] = -gBattleAnimArgs[1];
@ -230,7 +230,7 @@ static void AnimLeechLifeNeedle(struct Sprite *sprite)
gBattleAnimArgs[0] = -gBattleAnimArgs[0]; gBattleAnimArgs[0] = -gBattleAnimArgs[0];
StartSpriteAffineAnim(sprite, 2); StartSpriteAffineAnim(sprite, 2);
} }
else if (!GetBattlerSide(gBattleAnimTarget)) else if (GetBattlerSide(gBattleAnimTarget) == B_SIDE_PLAYER)
{ {
gBattleAnimArgs[1] = -gBattleAnimArgs[1]; gBattleAnimArgs[1] = -gBattleAnimArgs[1];
gBattleAnimArgs[0] = -gBattleAnimArgs[0]; gBattleAnimArgs[0] = -gBattleAnimArgs[0];
@ -301,7 +301,7 @@ static void AnimStringWrap(struct Sprite *sprite)
sprite->x += gBattleAnimArgs[0]; sprite->x += gBattleAnimArgs[0];
sprite->y += gBattleAnimArgs[1]; sprite->y += gBattleAnimArgs[1];
if (!GetBattlerSide(gBattleAnimTarget)) if (GetBattlerSide(gBattleAnimTarget) == B_SIDE_PLAYER)
sprite->y += 8; sprite->y += 8;
sprite->callback = AnimStringWrap_Step; sprite->callback = AnimStringWrap_Step;

View File

@ -926,7 +926,7 @@ static void CreateEruptionLaunchRocks(u8 spriteId, u8 taskId, u8 activeSpritesId
u16 y = GetEruptionLaunchRockInitialYPos(spriteId); u16 y = GetEruptionLaunchRockInitialYPos(spriteId);
u16 x = gSprites[spriteId].x; u16 x = gSprites[spriteId].x;
if(!GetBattlerSide(gBattleAnimAttacker)) if(GetBattlerSide(gBattleAnimAttacker) == B_SIDE_PLAYER)
{ {
x -= 12; x -= 12;
sign = 1; sign = 1;

View File

@ -910,8 +910,8 @@ static void AnimWhirlwindLine(struct Sprite * sprite)
else else
InitSpritePosToAnimTarget(sprite, FALSE); InitSpritePosToAnimTarget(sprite, FALSE);
if ((gBattleAnimArgs[2] == ANIM_ATTACKER && !GetBattlerSide(gBattleAnimAttacker)) if ((gBattleAnimArgs[2] == ANIM_ATTACKER && GetBattlerSide(gBattleAnimAttacker) == B_SIDE_PLAYER)
|| (gBattleAnimArgs[2] == ANIM_TARGET && !GetBattlerSide(gBattleAnimTarget))) || (gBattleAnimArgs[2] == ANIM_TARGET && GetBattlerSide(gBattleAnimTarget) == B_SIDE_PLAYER))
{ {
sprite->x += 8; sprite->x += 8;
} }

View File

@ -885,11 +885,11 @@ void AnimTask_RotateMonSpriteToSide(u8 taskId)
{ {
if (gBattleAnimArgs[2] == ANIM_ATTACKER) if (gBattleAnimArgs[2] == ANIM_ATTACKER)
{ {
gTasks[taskId].data[7] = !GetBattlerSide(gBattleAnimAttacker); gTasks[taskId].data[7] = GetBattlerSide(gBattleAnimAttacker) == B_SIDE_PLAYER;
} }
else else
{ {
gTasks[taskId].data[7] = !GetBattlerSide(gBattleAnimTarget); gTasks[taskId].data[7] = GetBattlerSide(gBattleAnimTarget) == B_SIDE_PLAYER;
} }
} }
if (gTasks[taskId].data[7]) if (gTasks[taskId].data[7])

View File

@ -2519,7 +2519,7 @@ void AnimWeatherBallUp(struct Sprite *sprite)
{ {
sprite->x = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2); sprite->x = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2);
sprite->y = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y_PIC_OFFSET); sprite->y = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y_PIC_OFFSET);
if (!GetBattlerSide(gBattleAnimAttacker)) if (GetBattlerSide(gBattleAnimAttacker) == B_SIDE_PLAYER)
sprite->data[0] = 5; sprite->data[0] = 5;
else else
sprite->data[0] = -10; sprite->data[0] = -10;
@ -2545,7 +2545,7 @@ void AnimWeatherBallDown(struct Sprite *sprite)
sprite->data[0] = gBattleAnimArgs[2]; sprite->data[0] = gBattleAnimArgs[2];
sprite->data[2] = sprite->x + gBattleAnimArgs[4]; sprite->data[2] = sprite->x + gBattleAnimArgs[4];
sprite->data[4] = sprite->y + gBattleAnimArgs[5]; sprite->data[4] = sprite->y + gBattleAnimArgs[5];
if (!GetBattlerSide(gBattleAnimTarget)) if (GetBattlerSide(gBattleAnimTarget) == B_SIDE_PLAYER)
{ {
x = (u16)gBattleAnimArgs[4] + 30; x = (u16)gBattleAnimArgs[4] + 30;
sprite->x += x; sprite->x += x;