summaryrefslogtreecommitdiff
path: root/src/battle_util.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/battle_util.c')
-rw-r--r--src/battle_util.c9
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;