From d50fb2dae61bc2715e8e78e1a0457d2024b21fb4 Mon Sep 17 00:00:00 2001 From: Alex <93446519+AlexOn1ine@users.noreply.github.com> Date: Sun, 4 Jan 2026 21:22:44 +0100 Subject: [PATCH] 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. --- include/battle.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/include/battle.h b/include/battle.h index 92f0dff02a..9609627869 100644 --- a/include/battle.h +++ b/include/battle.h @@ -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;