summaryrefslogtreecommitdiff
path: root/src/contest_effect.c
diff options
context:
space:
mode:
authorMarcus Huderle <huderlem@gmail.com>2018-08-12 20:32:27 -0500
committerMarcus Huderle <huderlem@gmail.com>2018-08-13 19:24:27 -0500
commit1ace1836679da5058213388ef825292eabbd6776 (patch)
tree5bed968fb46de1d43207da9c261303c313b732fc /src/contest_effect.c
parentdcf8c33a3b48ede46cf7e96491c0dbc2eb6c8073 (diff)
Decompile more of battle_anim_812C144.s
Diffstat (limited to 'src/contest_effect.c')
-rw-r--r--src/contest_effect.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/src/contest_effect.c b/src/contest_effect.c
index a5615851f..d97f38138 100644
--- a/src/contest_effect.c
+++ b/src/contest_effect.c
@@ -158,10 +158,8 @@ static void ContestEffect_StartlePrevMons(void)
u8 a = shared192D0.contestant;
if (shared192D0.turnOrder[a] != 0) {
- int i;
- int j = 0;
-
- for (i = 0; i < 4; i++)
+ int i, j;
+ for (i = 0, j = 0; i < 4; i++)
if (shared192D0.turnOrder[a] > shared192D0.turnOrder[i])
shared192D0.jamQueue[j++] = i;
shared192D0.jamQueue[j] = 0xFF;
@@ -1113,16 +1111,20 @@ static bool8 WasAtLeastOneOpponentJammed(void)
shared192D0.jam2 = 10;
SetContestantEffectStringID(contestant, CONTEST_STRING_LITTLE_DISTRACTED);
}
- else if ((shared192D0.jam2 -= sContestantStatus[contestant].jamReduction) <= 0)
- {
- shared192D0.jam2 = 0;
- SetContestantEffectStringID(contestant, CONTEST_STRING_NOT_FAZED);
- }
else
{
- JamContestant(contestant, shared192D0.jam2);
- SetStartledString(contestant, shared192D0.jam2);
- jamBuffer[contestant] = shared192D0.jam2;
+ shared192D0.jam2 -= sContestantStatus[contestant].jamReduction;
+ if (shared192D0.jam2 <= 0)
+ {
+ shared192D0.jam2 = 0;
+ SetContestantEffectStringID(contestant, CONTEST_STRING_NOT_FAZED);
+ }
+ else
+ {
+ JamContestant(contestant, shared192D0.jam2);
+ SetStartledString(contestant, shared192D0.jam2);
+ jamBuffer[contestant] = shared192D0.jam2;
+ }
}
}
}