Fix type check in Magnet Rise AI (#8609)

This commit is contained in:
grintoul 2025-12-21 11:26:21 +00:00 committed by GitHub
parent 828e12bee6
commit ae01e51f85
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -5519,7 +5519,7 @@ static s32 AI_CalcMoveEffectScore(u32 battlerAtk, u32 battlerDef, u32 move, stru
ADJUST_SCORE(GOOD_EFFECT);
break;
case EFFECT_MAGNET_RISE:
if (AI_IsBattlerGrounded(battlerAtk) && HasDamagingMoveOfType(battlerDef, TYPE_ELECTRIC)
if (AI_IsBattlerGrounded(battlerAtk) && HasDamagingMoveOfType(battlerDef, TYPE_GROUND)
&& !(effectiveness == UQ_4_12(0.0))) // Doesn't resist ground move
{
if (AI_IsFaster(battlerAtk, battlerDef, move, predictedMoveSpeedCheck, CONSIDER_PRIORITY)) // Attacker goes first
@ -5530,8 +5530,7 @@ static s32 AI_CalcMoveEffectScore(u32 battlerAtk, u32 battlerDef, u32 move, stru
}
else // Opponent Goes First
{
if (HasDamagingMoveOfType(battlerDef, TYPE_GROUND))
ADJUST_SCORE(DECENT_EFFECT);
ADJUST_SCORE(DECENT_EFFECT);
break;
}
}