diff options
author | luckytyphlosion <10688458+luckytyphlosion@users.noreply.github.com> | 2020-12-16 14:51:21 -0500 |
---|---|---|
committer | luckytyphlosion <10688458+luckytyphlosion@users.noreply.github.com> | 2020-12-16 14:51:21 -0500 |
commit | 34fc9789c9d11464161aabf022eb270597c6778a (patch) | |
tree | d7f97e29db99b3983d2d50678dcc250da179d32d /src/battle_util.c | |
parent | cc5db41f30708c1cc2d33a46879c96a9404764a3 (diff) | |
parent | 49bdaeb940afc98e3f98b24c9a5afe1bb8d5d86b (diff) |
Merge branch 'master' of https://github.com/pret/pokeemerald into rebase-install-md
Diffstat (limited to 'src/battle_util.c')
-rw-r--r-- | src/battle_util.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/battle_util.c b/src/battle_util.c index 7025f0e3f..e929de091 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -536,9 +536,12 @@ void HandleAction_ThrowPokeblock(void) gBattleStruct->safariPkblThrowCounter++; if (gBattleStruct->safariEscapeFactor > 1) { - // BUG: The safariEscapeFactor is unintetionally able to become 0 (but it can not become negative!). This causes the pokeblock throw glitch. - // To fix that change the < in the if statement below to <=. + // BUG: safariEscapeFactor can become 0 below. This causes the pokeblock throw glitch. + #ifdef BUGFIX + if (gBattleStruct->safariEscapeFactor <= sPkblToEscapeFactor[gBattleStruct->safariPkblThrowCounter][gBattleCommunication[MULTISTRING_CHOOSER]]) + #else if (gBattleStruct->safariEscapeFactor < sPkblToEscapeFactor[gBattleStruct->safariPkblThrowCounter][gBattleCommunication[MULTISTRING_CHOOSER]]) + #endif gBattleStruct->safariEscapeFactor = 1; else gBattleStruct->safariEscapeFactor -= sPkblToEscapeFactor[gBattleStruct->safariPkblThrowCounter][gBattleCommunication[MULTISTRING_CHOOSER]]; @@ -3818,7 +3821,7 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn) if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) && TARGET_TURN_DAMAGED && (Random() % 100) < atkHoldEffectParam - && gBattleMoves[gCurrentMove].flags & FLAG_KINGSROCK_AFFECTED + && gBattleMoves[gCurrentMove].flags & FLAG_KINGS_ROCK_AFFECTED && gBattleMons[gBattlerTarget].hp) { gBattleCommunication[MOVE_EFFECT_BYTE] = MOVE_EFFECT_FLINCH; |