From 8780d36222e69854a99f5233e6f81be43372aaa5 Mon Sep 17 00:00:00 2001 From: Hedara Date: Sun, 28 Jul 2024 17:04:01 +0200 Subject: [PATCH] Fixed Hidden Power damage category for PSS < GEN_4 --- src/battle_util.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/battle_util.c b/src/battle_util.c index e87fa9f368f4..c6c56d76482b 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -10828,6 +10828,7 @@ bool32 ShouldGetStatBadgeBoost(u16 badgeFlag, u32 battler) u8 GetBattleMoveCategory(u32 moveId) { + u8 moveType; if (gBattleStruct != NULL && gBattleStruct->zmove.active && !IS_MOVE_STATUS(moveId)) return gBattleStruct->zmove.activeCategory; if (gBattleStruct != NULL && IsMaxMove(moveId)) // TODO: Might be buggy depending on when this is called. @@ -10839,10 +10840,14 @@ u8 GetBattleMoveCategory(u32 moveId) if (IS_MOVE_STATUS(moveId)) return DAMAGE_CATEGORY_STATUS; - else if (gMovesInfo[moveId].type < TYPE_MYSTERY) - return DAMAGE_CATEGORY_PHYSICAL; else - return DAMAGE_CATEGORY_SPECIAL; + { + GET_MOVE_TYPE(moveId, moveType); + if (moveType < TYPE_MYSTERY) + return DAMAGE_CATEGORY_PHYSICAL; + else + return DAMAGE_CATEGORY_SPECIAL; + } } static bool32 TryRemoveScreens(u32 battler)