Allow 1-mon doubles without duplicating player lead

This commit is contained in:
MiyazakiTheFalse 2026-03-07 13:50:31 +00:00
parent e9ff05c45c
commit ddea807c87
2 changed files with 15 additions and 3 deletions

View File

@ -2323,6 +2323,15 @@ static void BattleStartClearSetData(void)
gBattleScripting.animTargetsHit = 0;
gLeveledUpInBattle = 0;
gAbsentBattlerFlags = 0;
if ((gBattleTypeFlags & BATTLE_TYPE_DOUBLE)
&& !(gBattleTypeFlags & (BATTLE_TYPE_MULTI | BATTLE_TYPE_LINK)))
{
u8 playerLeft = GetBattlerAtPosition(B_POSITION_PLAYER_LEFT);
u8 playerRight = GetBattlerAtPosition(B_POSITION_PLAYER_RIGHT);
if (gBattlerPartyIndexes[playerLeft] == gBattlerPartyIndexes[playerRight])
gAbsentBattlerFlags |= gBitTable[playerRight];
}
gBattleStruct->runTries = 0;
gBattleStruct->safariRockThrowCounter = 0;
gBattleStruct->safariBaitThrowCounter = 0;

View File

@ -94,12 +94,15 @@ void HasEnoughMonsForDoubleBattle(void)
case PLAYER_HAS_TWO_USABLE_MONS:
gSpecialVar_Result = PLAYER_HAS_TWO_USABLE_MONS;
break;
case PLAYER_HAS_ONE_USABLE_MON:
// Allow scripted double battles to start even when the player can only
// field one battler. Battle init will mark the right-side battler slot
// absent so the lead mon is not duplicated.
gSpecialVar_Result = PLAYER_HAS_TWO_USABLE_MONS;
break;
case PLAYER_HAS_ONE_MON:
gSpecialVar_Result = PLAYER_HAS_ONE_MON;
break;
case PLAYER_HAS_ONE_USABLE_MON:
gSpecialVar_Result = PLAYER_HAS_ONE_USABLE_MON;
break;
}
}