Remove bounds check in IsBattlerAlive

There is no reason for us to check for `battler > gBattlersCount` since it would return false positives half the time. 

But also if you pass `battler > gBattlersCount` then something massively wrong happened and you would get a bug either way.
This commit is contained in:
Alex 2026-01-04 21:22:44 +01:00 committed by GitHub
parent 52455d2c59
commit d50fb2dae6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1074,9 +1074,7 @@ extern u8 gCategoryIconSpriteId;
static inline bool32 IsBattlerAlive(u32 battler)
{
if (battler >= gBattlersCount)
return FALSE;
else if (gBattleMons[battler].hp == 0)
if (gBattleMons[battler].hp == 0)
return FALSE;
else if (gAbsentBattlerFlags & (1u << battler))
return FALSE;