mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2025-01-31 08:23:56 +01:00
Fix Teleport in double wild battles
This commit is contained in:
parent
573c1f888f
commit
c6a207c37b
@ -6456,10 +6456,25 @@ static void atk76_various(void)
|
|||||||
return;
|
return;
|
||||||
break;
|
break;
|
||||||
case VARIOUS_SET_TELEPORT_OUTCOME:
|
case VARIOUS_SET_TELEPORT_OUTCOME:
|
||||||
if (GetBattlerSide(gActiveBattler) == B_SIDE_PLAYER)
|
// Don't end the battle if one of the wild mons teleported from the wild double battle
|
||||||
|
// and its partner is still alive.
|
||||||
|
if (GetBattlerSide(gActiveBattler) == B_SIDE_OPPONENT && IsBattlerAlive(BATTLE_PARTNER(gActiveBattler)))
|
||||||
|
{
|
||||||
|
gAbsentBattlerFlags |= gBitTable[gActiveBattler];
|
||||||
|
gHitMarker |= HITMARKER_FAINTED(gActiveBattler);
|
||||||
|
gBattleMons[gActiveBattler].hp = 0;
|
||||||
|
SetMonData(&gEnemyParty[gBattlerPartyIndexes[gActiveBattler]], MON_DATA_HP, &gBattleMons[gActiveBattler].hp);
|
||||||
|
SetHealthboxSpriteInvisible(gHealthboxSpriteIds[gActiveBattler]);
|
||||||
|
FaintClearSetData();
|
||||||
|
}
|
||||||
|
else if (GetBattlerSide(gActiveBattler) == B_SIDE_PLAYER)
|
||||||
|
{
|
||||||
gBattleOutcome = B_OUTCOME_PLAYER_TELEPORTED;
|
gBattleOutcome = B_OUTCOME_PLAYER_TELEPORTED;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
gBattleOutcome = B_OUTCOME_MON_TELEPORTED;
|
gBattleOutcome = B_OUTCOME_MON_TELEPORTED;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case VARIOUS_PLAY_TRAINER_DEFEATED_MUSIC:
|
case VARIOUS_PLAY_TRAINER_DEFEATED_MUSIC:
|
||||||
BtlController_EmitPlayFanfareOrBGM(0, MUS_KACHI1, TRUE);
|
BtlController_EmitPlayFanfareOrBGM(0, MUS_KACHI1, TRUE);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user