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

Battle Item Refactor Fixes #3022

Merged

Conversation

AgustinGDLV
Copy link
Collaborator

@AgustinGDLV AgustinGDLV commented May 23, 2023

I should've gotten to these sooner, but this fixes a few outstanding issues.

#2943: Revives are buggy in 1v2 Battles.

This was a simple fix. The battle script to send out the revived battler was changed to use BS_SCRIPTING and gBattleScripting.battler was set when an item required a revive animation. Originally, it was using BS_ATTACKER, meaning it would perform a send out animation on the battler that used the item.

Revive Fix

#2967: Unable to cancel actions in a double battle after using an item.

I don't understand this fix if I'm being totally honest, but it works. In battle_controller_player.c, where B_ACTION_CANCEL_PARTNER_ACTION is supposed to be returned, I removed the Poke Ball check to return an item to the player's bag when cancelling an action after the first battler used an item. This was not meant to be the fix, but I couldn't find where to look next, and when doing some debug printing I noticed it was enough. Wonderful.

Cancel Fix

#2967: Bad item use battlestring.

This was a fix to BS_GetBattlerSide, which erroneously uses cmd->battler without passing it through GetBattlerForBattleScript. This means BS_ATTACKER will always be 1, so it will always print the enemy trainer string, which looks bugged for the player. There are other natives that seem to make this error as well.

Name Fix

Issue(s) that this PR fixes

Fixes #2943 and #2967.

Discord contact info

Agustin#1522

Copy link
Collaborator

@AsparagusEduardo AsparagusEduardo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@AsparagusEduardo AsparagusEduardo merged commit b972199 into rh-hideout:upcoming May 24, 2023
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.

Using a reviving item on a fainted Pokémon in 1v2 battles is buggy
2 participants