Various BUGFIXes and UBFIXes
This commit is contained in:
@@ -2766,13 +2766,22 @@ static int GetTypeEffectivenessPoints(int move, int targetSpecies, int arg2)
|
||||
}
|
||||
if (TYPE_EFFECT_ATK_TYPE(i) == moveType)
|
||||
{
|
||||
// BUG: TYPE_x2 is not necessary and makes the condition always false if the ability is wonder guard.
|
||||
// BUG: the value of TYPE_x2 does not exist in gTypeEffectiveness, so if defAbility is ABILITY_WONDER_GUARD, the conditional always fails
|
||||
#ifndef BUGFIX
|
||||
if (TYPE_EFFECT_DEF_TYPE(i) == defType1)
|
||||
if ((defAbility == ABILITY_WONDER_GUARD && TYPE_EFFECT_MULTIPLIER(i) == TYPE_x2) || defAbility != ABILITY_WONDER_GUARD)
|
||||
typePower = (typePower * TYPE_EFFECT_MULTIPLIER(i)) / 10;
|
||||
if (TYPE_EFFECT_DEF_TYPE(i) == defType2 && defType1 != defType2)
|
||||
if ((defAbility == ABILITY_WONDER_GUARD && TYPE_EFFECT_MULTIPLIER(i) == TYPE_x2) || defAbility != ABILITY_WONDER_GUARD)
|
||||
typePower = (typePower * TYPE_EFFECT_MULTIPLIER(i)) / 10;
|
||||
#else
|
||||
if (TYPE_EFFECT_DEF_TYPE(i) == defType1)
|
||||
if ((defAbility == ABILITY_WONDER_GUARD && TYPE_EFFECT_MULTIPLIER(i) == TYPE_MUL_SUPER_EFFECTIVE) || defAbility != ABILITY_WONDER_GUARD)
|
||||
typePower = (typePower * TYPE_EFFECT_MULTIPLIER(i)) / 10;
|
||||
if (TYPE_EFFECT_DEF_TYPE(i) == defType2 && defType1 != defType2)
|
||||
if ((defAbility == ABILITY_WONDER_GUARD && TYPE_EFFECT_MULTIPLIER(i) == TYPE_MUL_SUPER_EFFECTIVE) || defAbility != ABILITY_WONDER_GUARD)
|
||||
typePower = (typePower * TYPE_EFFECT_MULTIPLIER(i)) / 10;
|
||||
#endif
|
||||
}
|
||||
i += 3;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user