From 3343a16a7c00bb7eef9f7f261033ddd185d4c9cc Mon Sep 17 00:00:00 2001 From: Alex <93446519+AlexOn1ine@users.noreply.github.com> Date: Sat, 30 Nov 2024 23:49:50 +0100 Subject: [PATCH] Fixes Dynamax dynamic move type (#5739) --- src/battle_dynamax.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/battle_dynamax.c b/src/battle_dynamax.c index 073e2c55bcbd..e0b782d12cd4 100644 --- a/src/battle_dynamax.c +++ b/src/battle_dynamax.c @@ -280,7 +280,10 @@ static u16 GetTypeBasedMaxMove(u32 battler, u32 type) // Returns the appropriate Max Move or G-Max Move for a battler to use. u16 GetMaxMove(u32 battler, u32 baseMove) { - u32 move = baseMove; + u32 moveType; + SetTypeBeforeUsingMove(baseMove, battler); + GET_MOVE_TYPE(baseMove, moveType); + if (baseMove == MOVE_NONE) // for move display { return MOVE_NONE; @@ -291,18 +294,12 @@ u16 GetMaxMove(u32 battler, u32 baseMove) } else if (gMovesInfo[baseMove].category == DAMAGE_CATEGORY_STATUS) { - move = MOVE_MAX_GUARD; - } - else if (gBattleStruct->dynamicMoveType) - { - move = GetTypeBasedMaxMove(battler, gBattleStruct->dynamicMoveType & DYNAMIC_TYPE_MASK); + return MOVE_MAX_GUARD; } else { - move = GetTypeBasedMaxMove(battler, gMovesInfo[baseMove].type); + return GetTypeBasedMaxMove(battler, moveType); } - - return move; } // First value is for Fighting, Poison and Multi-Attack. The second is for everything else.