Redefine IsBattlerAlive in battle.h as a static inline (#6211)

This commit is contained in:
Alex 2025-02-09 20:09:23 +01:00 committed by GitHub
parent 621d2ef83d
commit 5f13f9545f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 12 additions and 13 deletions

View File

@ -1186,6 +1186,18 @@ extern bool8 gLastUsedBallMenuPresent;
extern u8 gPartyCriticalHits[PARTY_SIZE];
extern u8 gCategoryIconSpriteId;
static inline bool32 IsBattlerAlive(u32 battler)
{
if (gBattleMons[battler].hp == 0)
return FALSE;
else if (battler >= gBattlersCount)
return FALSE;
else if (gAbsentBattlerFlags & (1u << battler))
return FALSE;
else
return TRUE;
}
static inline bool32 IsBattlerTurnDamaged(u32 battler)
{
return gSpecialStatuses[battler].physicalDmg != 0

View File

@ -241,7 +241,6 @@ u32 GetBattlerHoldEffectInternal(u32 battler, bool32 checkNegating, bool32 check
u32 GetBattlerHoldEffectParam(u32 battler);
bool32 IsMoveMakingContact(u32 move, u32 battlerAtk);
bool32 IsBattlerGrounded(u32 battler);
bool32 IsBattlerAlive(u32 battler);
u32 GetMoveSlot(u16 *moves, u32 move);
u32 GetBattlerWeight(u32 battler);
u32 CalcRolloutBasePower(u32 battlerAtk, u32 basePower, u32 rolloutTimer);

View File

@ -8853,18 +8853,6 @@ bool32 IsBattlerGrounded(u32 battler)
return IsBattlerGroundedInverseCheck(battler, FALSE);
}
bool32 IsBattlerAlive(u32 battler)
{
if (gBattleMons[battler].hp == 0)
return FALSE;
else if (battler >= gBattlersCount)
return FALSE;
else if (gAbsentBattlerFlags & (1u << battler))
return FALSE;
else
return TRUE;
}
u32 GetMoveSlot(u16 *moves, u32 move)
{
u32 i;