-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace hp checks with IsBattlerAlive #4429
Conversation
…d .hp == 0 checks to IsBattlerAlive
I wasn't able to repro the toxic / flame orb bug and it seems there is already a check when
So the second check is redundant. /Edit: Ghoul you fixed it yourself in #2585 😅 |
lol that's funny. oops. Just removed the redundant checks |
src/battle_util.c
Outdated
@@ -7954,7 +7954,7 @@ u8 ItemBattleEffects(u8 caseID, u32 battler, bool32 moveTurn) | |||
} | |||
break; | |||
case HOLD_EFFECT_STICKY_BARB: // Not an orb per se, but similar effect, and needs to NOT activate with pickpocket | |||
if (battlerAbility != ABILITY_MAGIC_GUARD) | |||
if (IsBattlerAlive(battler) && battlerAbility != ABILITY_MAGIC_GUARD) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this one isn't needed as well.
Can't find an issue number, but this fixes Toxic/Flame Orb from activating on fainted battlers.
Also updated a bunch of .hp != 0 --> IsBattlerAlive and .hp == 0 to !IsBattlerAlive while I was at it