mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-12-26 03:34:15 +01:00
Use MAX_MON_MOVES in Cmd_trysetencore
This commit is contained in:
parent
186f2c0232
commit
167353223c
@ -2553,9 +2553,9 @@ void SetMoveEffect(bool8 primary, u8 certain)
|
|||||||
case MOVE_EFFECT_PAYDAY:
|
case MOVE_EFFECT_PAYDAY:
|
||||||
if (GET_BATTLER_SIDE(gBattlerAttacker) == B_SIDE_PLAYER)
|
if (GET_BATTLER_SIDE(gBattlerAttacker) == B_SIDE_PLAYER)
|
||||||
{
|
{
|
||||||
u16 payDay = gPaydayMoney;
|
u16 payday = gPaydayMoney;
|
||||||
gPaydayMoney += (gBattleMons[gBattlerAttacker].level * 5);
|
gPaydayMoney += (gBattleMons[gBattlerAttacker].level * 5);
|
||||||
if (payDay > gPaydayMoney)
|
if (payday > gPaydayMoney)
|
||||||
gPaydayMoney = 0xFFFF;
|
gPaydayMoney = 0xFFFF;
|
||||||
}
|
}
|
||||||
BattleScriptPush(gBattlescriptCurrInstr + 1);
|
BattleScriptPush(gBattlescriptCurrInstr + 1);
|
||||||
@ -7938,11 +7938,11 @@ static void Cmd_trysetencore(void)
|
|||||||
|| gLastMoves[gBattlerTarget] == MOVE_ENCORE
|
|| gLastMoves[gBattlerTarget] == MOVE_ENCORE
|
||||||
|| gLastMoves[gBattlerTarget] == MOVE_MIRROR_MOVE)
|
|| gLastMoves[gBattlerTarget] == MOVE_MIRROR_MOVE)
|
||||||
{
|
{
|
||||||
i = 4;
|
i = MAX_MON_MOVES;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gDisableStructs[gBattlerTarget].encoredMove == MOVE_NONE
|
if (gDisableStructs[gBattlerTarget].encoredMove == MOVE_NONE
|
||||||
&& i != 4 && gBattleMons[gBattlerTarget].pp[i] != 0)
|
&& i != MAX_MON_MOVES && gBattleMons[gBattlerTarget].pp[i] != 0)
|
||||||
{
|
{
|
||||||
gDisableStructs[gBattlerTarget].encoredMove = gBattleMons[gBattlerTarget].moves[i];
|
gDisableStructs[gBattlerTarget].encoredMove = gBattleMons[gBattlerTarget].moves[i];
|
||||||
gDisableStructs[gBattlerTarget].encoredMovePos = i;
|
gDisableStructs[gBattlerTarget].encoredMovePos = i;
|
||||||
|
Loading…
Reference in New Issue
Block a user