Fixes wrongly usage of arguments without checking effect (#6859)

This commit is contained in:
Alex 2025-05-15 10:39:31 +02:00 committed by GitHub
parent ad0e98bb12
commit 34918f5f0d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 2 additions and 9 deletions

View File

@ -819,11 +819,6 @@ static inline bool32 IsBattleMoveStatus(u32 move)
return GetMoveCategory(move) == DAMAGE_CATEGORY_STATUS;
}
static inline bool32 IsBattleMoveRecoil(u32 move)
{
return GetMoveRecoil(move) > 0 || GetMoveEffect(move) == EFFECT_RECOIL_IF_MISS;
}
/* Checks if 'battlerId' is any of the types.
* Passing multiple types is more efficient than calling this multiple
* times with one type because it shares the 'GetBattlerTypes' result. */

View File

@ -972,10 +972,8 @@ static bool32 AI_IsMoveEffectInMinus(u32 battlerAtk, u32 battlerDef, u32 move, s
case EFFECT_EXPLOSION:
case EFFECT_FINAL_GAMBIT:
return TRUE;
case EFFECT_RECOIL_IF_MISS:
if (AI_IsDamagedByRecoil(battlerAtk))
return TRUE;
case EFFECT_RECOIL:
case EFFECT_RECOIL_IF_MISS:
if (AI_IsDamagedByRecoil(battlerAtk))
return TRUE;
break;

View File

@ -8396,7 +8396,7 @@ static inline u32 CalcMoveBasePowerAfterModifiers(struct DamageCalculationData *
modifier = uq4_12_multiply(modifier, UQ_4_12(1.5));
break;
case ABILITY_RECKLESS:
if (IsBattleMoveRecoil(move))
if (moveEffect == EFFECT_RECOIL || moveEffect == EFFECT_RECOIL_IF_MISS)
modifier = uq4_12_multiply(modifier, UQ_4_12(1.2));
break;
case ABILITY_IRON_FIST: