diff --git a/src/battle_anim_effects_2.c b/src/battle_anim_effects_2.c index c443a5c01..1add76bf3 100755 --- a/src/battle_anim_effects_2.c +++ b/src/battle_anim_effects_2.c @@ -1646,7 +1646,7 @@ void sub_8103CF0(u8 taskId) } else { - if ((gBattlerPositions[gBattleAnimTarget] & 1) == 0) + if ((gBattlerPositions[gBattleAnimTarget] & BIT_SIDE) == B_SIDE_PLAYER) { gTasks[taskId].data[4] = 1; gBattleAnimArgs[0] = -gBattleAnimArgs[0]; diff --git a/src/battle_controllers.c b/src/battle_controllers.c index 4b5bb7a8a..acb01c2ea 100644 --- a/src/battle_controllers.c +++ b/src/battle_controllers.c @@ -234,16 +234,16 @@ static void InitSinglePlayerBtlControllers(void) gBattleMainFunc = BeginBattleIntro; gBattlerControllerFuncs[0] = SetControllerToRecordedPlayer; - gBattlerPositions[0] = 0; + gBattlerPositions[0] = B_POSITION_PLAYER_LEFT; gBattlerControllerFuncs[1] = SetControllerToOpponent; - gBattlerPositions[1] = 1; + gBattlerPositions[1] = B_POSITION_OPPONENT_LEFT; gBattlerControllerFuncs[2] = SetControllerToRecordedPlayer; - gBattlerPositions[2] = 2; + gBattlerPositions[2] = B_POSITION_PLAYER_RIGHT; gBattlerControllerFuncs[3] = SetControllerToOpponent; - gBattlerPositions[3] = 3; + gBattlerPositions[3] = B_POSITION_OPPONENT_RIGHT; gBattlersCount = MAX_BATTLERS_COUNT; @@ -524,12 +524,12 @@ static void InitLinkBtlControllers(void) { case 0: case 3: - gBattlerPositions[gLinkPlayers[i].id] = 0; + gBattlerPositions[gLinkPlayers[i].id] = B_POSITION_PLAYER_LEFT; gBattlerPartyIndexes[gLinkPlayers[i].id] = 0; break; case 1: case 2: - gBattlerPositions[gLinkPlayers[i].id] = 2; + gBattlerPositions[gLinkPlayers[i].id] = B_POSITION_PLAYER_RIGHT; gBattlerPartyIndexes[gLinkPlayers[i].id] = 3; break; } @@ -544,12 +544,12 @@ static void InitLinkBtlControllers(void) { case 0: case 3: - gBattlerPositions[gLinkPlayers[i].id] = 0; + gBattlerPositions[gLinkPlayers[i].id] = B_POSITION_PLAYER_LEFT; gBattlerPartyIndexes[gLinkPlayers[i].id] = 0; break; case 1: case 2: - gBattlerPositions[gLinkPlayers[i].id] = 2; + gBattlerPositions[gLinkPlayers[i].id] = B_POSITION_PLAYER_RIGHT; gBattlerPartyIndexes[gLinkPlayers[i].id] = 3; break; } @@ -561,12 +561,12 @@ static void InitLinkBtlControllers(void) { case 0: case 3: - gBattlerPositions[gLinkPlayers[i].id] = 1; + gBattlerPositions[gLinkPlayers[i].id] = B_POSITION_OPPONENT_LEFT; gBattlerPartyIndexes[gLinkPlayers[i].id] = 0; break; case 1: case 2: - gBattlerPositions[gLinkPlayers[i].id] = 3; + gBattlerPositions[gLinkPlayers[i].id] = B_POSITION_OPPONENT_RIGHT; gBattlerPartyIndexes[gLinkPlayers[i].id] = 3; break; } diff --git a/src/battle_gfx_sfx_util.c b/src/battle_gfx_sfx_util.c index cdd7e8158..de403aec7 100644 --- a/src/battle_gfx_sfx_util.c +++ b/src/battle_gfx_sfx_util.c @@ -779,7 +779,7 @@ bool8 BattleInitAllSprites(u8 *state1, u8 *battlerId) break; case 4: InitBattlerHealthboxCoords(*battlerId); - if (gBattlerPositions[*battlerId] <= 1) + if (gBattlerPositions[*battlerId] <= B_POSITION_OPPONENT_LEFT) DummyBattleInterfaceFunc(gHealthboxSpriteIds[*battlerId], FALSE); else DummyBattleInterfaceFunc(gHealthboxSpriteIds[*battlerId], TRUE); diff --git a/src/contest.c b/src/contest.c index 662a27060..79c1616c2 100644 --- a/src/contest.c +++ b/src/contest.c @@ -1217,10 +1217,10 @@ static bool8 SetupContestGraphics(u8 *stateVar) CreateApplauseMeterSprite(); sub_80DC5E8(); sub_80DC7EC(); - gBattlerPositions[0] = 0; - gBattlerPositions[1] = 1; - gBattlerPositions[2] = 3; - gBattlerPositions[3] = 2; + gBattlerPositions[0] = B_POSITION_PLAYER_LEFT; + gBattlerPositions[1] = B_POSITION_OPPONENT_LEFT; + gBattlerPositions[2] = B_POSITION_OPPONENT_RIGHT; + gBattlerPositions[3] = B_POSITION_PLAYER_RIGHT; gBattleTypeFlags = 0; gBattlerAttacker = 2; gBattlerTarget = 3; diff --git a/src/fire.c b/src/fire.c index f87a9e4bb..fdbfb234e 100644 --- a/src/fire.c +++ b/src/fire.c @@ -1181,7 +1181,7 @@ void sub_8109DBC(u8 taskId) { struct Task *task = &gTasks[taskId]; - task->data[12] = !GetBattlerSide(gBattleAnimAttacker) ? B_SIDE_OPPONENT : -1; + task->data[12] = !GetBattlerSide(gBattleAnimAttacker) ? 1 : -1; task->data[13] = IsBattlerSpriteVisible(gBattleAnimTarget ^ 2) + 1; task->data[14] = GetAnimBattlerSpriteId(1); task->data[15] = GetAnimBattlerSpriteId(3); diff --git a/src/ice.c b/src/ice.c index 4dbf5c4df..522fb1bbf 100644 --- a/src/ice.c +++ b/src/ice.c @@ -1190,12 +1190,12 @@ void InitPoisonGasCloudAnim(struct Sprite *sprite) if (GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2) < GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2)) sprite->data[7] = 0x8000; - if (!(gBattlerPositions[gBattleAnimTarget] & 1)) + if ((gBattlerPositions[gBattleAnimTarget] & BIT_SIDE) == B_SIDE_PLAYER) { gBattleAnimArgs[1] = -gBattleAnimArgs[1]; gBattleAnimArgs[3] = -gBattleAnimArgs[3]; - if ((sprite->data[7] & 0x8000) && !(gBattlerPositions[gBattleAnimAttacker] & 1)) + if ((sprite->data[7] & 0x8000) && (gBattlerPositions[gBattleAnimAttacker] & BIT_SIDE) == B_SIDE_PLAYER) sprite->subpriority = gSprites[GetAnimBattlerSpriteId(ANIM_TARGET)].subpriority + 1; sprite->data[6] = 1;