Battle Item Refactor Fixes (#3022)

This commit is contained in:
Eduardo Quezada D'Ottone 2023-05-23 21:32:57 -04:00 committed by GitHub
commit b972199141
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 8 deletions

View File

@ -59,9 +59,9 @@ BattleScript_ItemRestoreHP::
end
BattleScript_ItemRestoreHP_SendOutRevivedBattler:
switchinanim BS_ATTACKER, FALSE
switchinanim BS_SCRIPTING, FALSE
waitstate
switchineffects BS_ATTACKER
switchineffects BS_SCRIPTING
end
BattleScript_ItemCureStatus::

View File

@ -312,13 +312,10 @@ static void HandleInputChooseAction(void)
&& !(gAbsentBattlerFlags & gBitTable[GetBattlerAtPosition(B_POSITION_PLAYER_LEFT)])
&& !(gBattleTypeFlags & BATTLE_TYPE_MULTI))
{
// Return item to bag if partner had selected one.
if (gBattleResources->bufferA[gActiveBattler][1] == B_ACTION_USE_ITEM)
{
// Add item to bag if it is a ball
if (itemId <= LAST_BALL)
AddBagItem(itemId, 1);
else
return;
AddBagItem(itemId, 1);
}
PlaySE(SE_SELECT);
BtlController_EmitTwoReturnValues(BUFFER_B, B_ACTION_CANCEL_PARTNER, 0);

View File

@ -16324,7 +16324,7 @@ void BS_CheckParentalBondCounter(void)
void BS_GetBattlerSide(void)
{
NATIVE_ARGS(u8 battler);
gBattleCommunication[0] = GetBattlerSide(cmd->battler);
gBattleCommunication[0] = GetBattlerSide(GetBattlerForBattleScript(cmd->battler));
gBattlescriptCurrInstr = cmd->nextInstr;
}
@ -16500,6 +16500,7 @@ void BS_ItemRestoreHP(void)
if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE && battlerId != MAX_BATTLERS_COUNT)
{
gAbsentBattlerFlags &= ~gBitTable[battlerId];
gBattleScripting.battler = battlerId;
gBattleCommunication[MULTIUSE_STATE] = TRUE;
}
}