Fixes Dynamax dynamic move type (#5739)

This commit is contained in:
Alex 2024-11-30 23:49:50 +01:00 committed by GitHub
parent 51fbc80ac5
commit 3343a16a7c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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.