fix AI_WeatherHasEffect to handle unknown abilities

This commit is contained in:
Evan 2021-01-10 08:58:41 -07:00
parent e748db8ef4
commit bb540b6236

View File

@ -1128,10 +1128,18 @@ bool32 DoesBattlerIgnoreAbilityChecks(u16 atkAbility, u16 move)
bool32 AI_WeatherHasEffect(void) bool32 AI_WeatherHasEffect(void)
{ {
u32 i;
if (AI_THINKING_STRUCT->aiFlags & AI_FLAG_NEGATE_UNAWARE) if (AI_THINKING_STRUCT->aiFlags & AI_FLAG_NEGATE_UNAWARE)
return FALSE; // AI doesn't understand ability suppression concept return FALSE; // AI doesn't understand weather supression (handicap)
return WEATHER_HAS_EFFECT; // need to manually check since we don't necessarily know opponent ability
for (i = 0; i < gBattlersCount; i++)
{
if (IsBattlerAlive(i)
&& (AI_GetAbility(i) == ABILITY_AIR_LOCK || AI_GetAbility(i) == ABILITY_CLOUD_NINE)
return TRUE;
}
return FALSE;
} }
bool32 IsAromaVeilProtectedMove(u16 move) bool32 IsAromaVeilProtectedMove(u16 move)