diff --git a/data/maps/EverGrandeCity_PokemonLeague_1F/scripts.inc b/data/maps/EverGrandeCity_PokemonLeague_1F/scripts.inc index 27ac842afc..e94e9c0973 100644 --- a/data/maps/EverGrandeCity_PokemonLeague_1F/scripts.inc +++ b/data/maps/EverGrandeCity_PokemonLeague_1F/scripts.inc @@ -47,13 +47,21 @@ EverGrandeCity_PokemonLeague_1F_Pokemart_229624: @ 8229624 end EverGrandeCity_PokemonLeague_1F_EventScript_229636:: @ 8229636 - trainerbattle 10, 406, 0, NULL, EverGrandeCity_PokemonLeague_1F_Text_2297EF, NULL - trainerbattle 11, 402, 0, NULL, EverGrandeCity_PokemonLeague_1F_Text_2297EF, NULL + special SavePlayerParty + + trainerbattle 10, 406, 0, NULL, EverGrandeCity_PokemonLeague_1F_Text_2297EF + trainerbattle 11, 402, 0, NULL, EverGrandeCity_PokemonLeague_1F_Text_2297EF + setvar VAR_0x8004, 11 + setvar VAR_0x8005, 0 setvar VAR_0x8006, 404 setvar VAR_0x8007, 3 special DoSpecialTrainerBattle + waitstate + + special LoadPlayerParty + lockall checkflag FLAG_0x107 goto_eq EverGrandeCity_PokemonLeague_1F_EventScript_2296BB diff --git a/src/battle_setup.c b/src/battle_setup.c index 7770815b13..f9b1be91e5 100644 --- a/src/battle_setup.c +++ b/src/battle_setup.c @@ -1086,7 +1086,8 @@ void SetMapVarsToTrainer(void) const u8 *BattleSetup_ConfigureTrainerBattle(const u8 *data) { - InitTrainerBattleVariables(); + if (TrainerBattleLoadArg8(data) != TRAINER_BATTLE_SET_TRAINER_B) + InitTrainerBattleVariables(); sTrainerBattleMode = TrainerBattleLoadArg8(data); switch (sTrainerBattleMode) diff --git a/src/battle_tower.c b/src/battle_tower.c index 2131b5d11c..f881d4bccc 100644 --- a/src/battle_tower.c +++ b/src/battle_tower.c @@ -1330,6 +1330,13 @@ static void HandleSpecialTrainerBattleEnd(void) case SPECIAL_BATTLE_EREADER: CopyEReaderTrainerFarewellMessage(); break; + case SPECIAL_BATTLE_MULTI: + for (i = 0; i < 3; i++) + { + if (GetMonData(&gPlayerParty[i], MON_DATA_SPECIES)) + gSaveBlock1Ptr->playerParty[i] = gPlayerParty[i]; + } + break; } SetMainCallback2(CB2_ReturnToFieldContinueScriptPlayMapMusic);