summaryrefslogtreecommitdiff
path: root/src/battle_main.c
diff options
context:
space:
mode:
authorPokeCodec <67983839+PokeCodec@users.noreply.github.com>2020-09-06 20:01:16 -0400
committerPokeCodec <67983839+PokeCodec@users.noreply.github.com>2020-09-06 20:01:16 -0400
commit5f7a410359ea4036c43cbe182a49c7b0f878e227 (patch)
tree4b82482bdb326685e93f6422620f70efbfd776b8 /src/battle_main.c
parent8200682b21fc6e9bb61e20a300fccb30970b995f (diff)
Preparation for matching BattleIntroOpponent1SendsOutMonAnimation
Diffstat (limited to 'src/battle_main.c')
-rw-r--r--src/battle_main.c30
1 files changed, 17 insertions, 13 deletions
diff --git a/src/battle_main.c b/src/battle_main.c
index 2e280b4c8..e62513680 100644
--- a/src/battle_main.c
+++ b/src/battle_main.c
@@ -3610,17 +3610,22 @@ static void BattleIntroOpponent1SendsOutMonAnimation(void)
{
u8 position;
- if (!(gBattleTypeFlags & BATTLE_TYPE_RECORDED))
- position = B_POSITION_OPPONENT_LEFT;
- else if (gBattleTypeFlags & BATTLE_TYPE_x2000000)
+ if (gBattleTypeFlags & BATTLE_TYPE_RECORDED)
{
- if (gBattleTypeFlags & BATTLE_TYPE_x80000000)
- position = B_POSITION_OPPONENT_LEFT;
+ if (gBattleTypeFlags & BATTLE_TYPE_x2000000)
+ {
+ if (gBattleTypeFlags & BATTLE_TYPE_x80000000)
+ position = B_POSITION_OPPONENT_LEFT;
+ else
+ position = B_POSITION_PLAYER_LEFT;
+ }
else
- position = B_POSITION_PLAYER_LEFT;
+ position = B_POSITION_OPPONENT_LEFT;
}
else
+ {
position = B_POSITION_OPPONENT_LEFT;
+ }
if (gBattleControllerExecFlags)
return;
@@ -5099,15 +5104,15 @@ static void HandleEndTurn_RanFromBattle(void)
{
switch (gProtectStructs[gBattlerAttacker].fleeFlag)
{
- default:
- gBattlescriptCurrInstr = BattleScript_GotAwaySafely;
- break;
case 1:
gBattlescriptCurrInstr = BattleScript_SmokeBallEscape;
break;
case 2:
gBattlescriptCurrInstr = BattleScript_RanAwayUsingMonAbility;
break;
+ default:
+ gBattlescriptCurrInstr = BattleScript_GotAwaySafely;
+ break;
}
}
@@ -5191,10 +5196,7 @@ static void FreeResetData_ReturnToOvOrDoEvolutions(void)
gBattleMainFunc = ReturnFromBattleToOverworld;
return;
}
- else
- {
- gBattleMainFunc = TryEvolvePokemon;
- }
+ gBattleMainFunc = TryEvolvePokemon;
}
FreeAllWindowBuffers();
@@ -5530,7 +5532,9 @@ static void HandleAction_UseItem(void)
gBattlerAttacker = gBattlerTarget = gBattlerByTurnOrder[gCurrentTurnActionNumber];
gBattle_BG0_X = 0;
gBattle_BG0_Y = 0;
+
ClearFuryCutterDestinyBondGrudge(gBattlerAttacker);
+
gLastUsedItem = gBattleBufferB[gBattlerAttacker][1] | (gBattleBufferB[gBattlerAttacker][2] << 8);
if (gLastUsedItem <= LAST_BALL) // is ball