Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed switchout bug in multibattle where order of mons gets messed up #2099

Merged
merged 10 commits into from
Jan 29, 2025

Conversation

shachar700
Copy link
Contributor

Fixed switchout bug that messed the order of pokemon in the summary screen after the opponent uses switchout moves (whirlwind, roar, etc...).

PROBLEM:
Screenshot_12

PROBLEM: If the opponent uses forced switchout moves in a multi battle, the player side party might get the order messed up where the mons appear in the wrong slots of the party screen.
This causes a hardlock when all mons on the player side are knocked out and the player can't select their mon that's on the partner side of the party screen.

FIX: Entered the switchout effects inside the if (TryDoForceSwitchOut()) statement, also adjusted firstmonId and lastmonId to stay between the boundaries of each player (0-2 PLAYER, 3-5 STEVEN)

Description

#2093 Fixes

Discord contact info

Shachar700

@mrgriffin
Copy link
Collaborator

This is going to need #ifdef BUGFIX...#endifs around it, because it doesn't match as-is.

src/battle_script_commands.c Outdated Show resolved Hide resolved
src/battle_script_commands.c Outdated Show resolved Hide resolved
shachar700 and others added 2 commits January 28, 2025 12:42
@mrgriffin
Copy link
Collaborator

Without the fix is it possible for my Pokémon to get switched with one of Steven's or does the bug only manifest in the party screen? How would you recommend to test the fix?

@shachar700
Copy link
Contributor Author

shachar700 commented Jan 28, 2025

I recommend to test the fix by:

  • Getting 3 different pokemon
  • Putting a sign in littleroot town with the script "MossdeepCity_SpaceCenter_2F_EventScript_ChoosePartyForMultiBattle"
  • Giving the opponent switchout moves (roar, whirlwind, etc...)
    Check pokemon summary screen after every turn.

The fix fixes the case where mightyena is on your side of the field.
And also the order of the pokemon in the summary screen not getting scrambled with steven's slots.

@shachar700 shachar700 requested a review from mrgriffin January 28, 2025 10:54
@mrgriffin mrgriffin merged commit 95aa41f into pret:master Jan 29, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants