fix eject button

This commit is contained in:
ghoulslash 2021-09-03 14:56:36 -04:00
parent 5c5276b04d
commit 79f39a1fd0
2 changed files with 3 additions and 3 deletions

View File

@ -8057,7 +8057,6 @@ BattleScript_RedCardSuctionCups:
return
BattleScript_EjectButtonActivates::
jumpifcantswitch BS_SCRIPTING, BattleScript_EjectButtonEnd
makevisible BS_ATTACKER
playanimation BS_SCRIPTING, B_ANIM_HELD_ITEM_EFFECT, NULL
printstring STRINGID_EJECTBUTTONACTIVATE

View File

@ -5070,11 +5070,12 @@ static void Cmd_moveend(void)
case MOVEEND_EJECT_BUTTON:
if (gCurrentMove != MOVE_DRAGON_TAIL
&& gCurrentMove != MOVE_CIRCLE_THROW
&& !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT)
&& IsBattlerAlive(gBattlerAttacker)
&& !TestSheerForceFlag(gBattlerAttacker, gCurrentMove)
&& (GetBattlerSide(gBattlerAttacker) == B_SIDE_PLAYER || (gBattleTypeFlags & BATTLE_TYPE_TRAINER)))
{
// Since we check if battler was damaged, we don't need to check move result.
// In fact, doing so actually prevents multi-target moves from activating eject button properly
u8 battlers[4] = {0, 1, 2, 3};
SortBattlersBySpeed(battlers, FALSE);
for (i = 0; i < gBattlersCount; i++)
@ -5106,7 +5107,7 @@ static void Cmd_moveend(void)
&& IsBattlerAlive(gBattlerAttacker)
&& !TestSheerForceFlag(gBattlerAttacker, gCurrentMove))
{
// since we check if battler was damaged, we don't need to check move result.
// Since we check if battler was damaged, we don't need to check move result.
// In fact, doing so actually prevents multi-target moves from activating red card properly
u8 battlers[4] = {0, 1, 2, 3};
SortBattlersBySpeed(battlers, FALSE);