Fix Baton Pass breaking on Memento (#4773)
* Fix Baton Pass breaking on Memento * doubled headers
This commit is contained in:
parent
251019d63d
commit
a17259763c
2 changed files with 30 additions and 2 deletions
|
@ -7032,8 +7032,12 @@ static void Cmd_openpartyscreen(void)
|
||||||
if (gAbsentBattlerFlags & gBitTable[battlerOpposite])
|
if (gAbsentBattlerFlags & gBitTable[battlerOpposite])
|
||||||
battlerOpposite ^= BIT_FLANK;
|
battlerOpposite ^= BIT_FLANK;
|
||||||
|
|
||||||
BtlController_EmitLinkStandbyMsg(battlerOpposite, BUFFER_A, LINK_STANDBY_MSG_ONLY, FALSE);
|
// Make sure we're checking a valid battler. In edge case scenarios - battler could be absent and battlerOpposite would become a non-existent one softlocking the game.
|
||||||
MarkBattlerForControllerExec(battlerOpposite);
|
if (battlerOpposite < gBattlersCount)
|
||||||
|
{
|
||||||
|
BtlController_EmitLinkStandbyMsg(battlerOpposite, BUFFER_A, LINK_STANDBY_MSG_ONLY, FALSE);
|
||||||
|
MarkBattlerForControllerExec(battlerOpposite);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,30 @@
|
||||||
#include "global.h"
|
#include "global.h"
|
||||||
#include "test/battle.h"
|
#include "test/battle.h"
|
||||||
|
|
||||||
|
ASSUMPTIONS
|
||||||
|
{
|
||||||
|
ASSUME(gMovesInfo[MOVE_BATON_PASS].effect == EFFECT_BATON_PASS);
|
||||||
|
}
|
||||||
|
|
||||||
|
// This softlocked the game before.
|
||||||
|
SINGLE_BATTLE_TEST("Baton Pass used after Memento works correctly")
|
||||||
|
{
|
||||||
|
GIVEN {
|
||||||
|
PLAYER(SPECIES_WOBBUFFET);
|
||||||
|
PLAYER(SPECIES_WOBBUFFET);
|
||||||
|
OPPONENT(SPECIES_WYNAUT);
|
||||||
|
OPPONENT(SPECIES_CATERPIE);
|
||||||
|
} WHEN {
|
||||||
|
TURN { MOVE(player, MOVE_MEMENTO); SEND_OUT(player, 1); MOVE(opponent, MOVE_BATON_PASS); SEND_OUT(opponent, 1); }
|
||||||
|
} SCENE {
|
||||||
|
MESSAGE("Wobbuffet used Memento!");
|
||||||
|
MESSAGE("Wobbuffet fainted!");
|
||||||
|
MESSAGE("Foe Wynaut used Baton Pass!");
|
||||||
|
MESSAGE("2 sent out Caterpie!");
|
||||||
|
MESSAGE("Go! Wobbuffet!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
TO_DO_BATTLE_TEST("Baton Pass switches out the user");
|
TO_DO_BATTLE_TEST("Baton Pass switches out the user");
|
||||||
TO_DO_BATTLE_TEST("Baton Pass fails if there's no valid party Pokémon left");
|
TO_DO_BATTLE_TEST("Baton Pass fails if there's no valid party Pokémon left");
|
||||||
TO_DO_BATTLE_TEST("Baton Pass passes both positive and negative stat changes");
|
TO_DO_BATTLE_TEST("Baton Pass passes both positive and negative stat changes");
|
||||||
|
|
Loading…
Reference in a new issue