mirror of https://github.com/pret/pokeemerald.git
Cleaner place to not run from double battle added.
parent
d6f9926bee
commit
f206da38f7
|
@ -186,7 +186,7 @@ EWRAM_DATA u16 gBattle_BG0_X = 0;
|
|||
|
||||
+static u8 IsTrainerCantRunFrom(void){
|
||||
+ u8 trainerClass;
|
||||
+ if (gBattleTypeFlags & (BATTLE_TYPE_FRONTIER | BATTLE_TYPE_TRAINER_HILL))
|
||||
+ if (gBattleTypeFlags & (BATTLE_TYPE_DOUBLE | BATTLE_TYPE_FRONTIER | BATTLE_TYPE_TRAINER_HILL))
|
||||
+ return BATTLE_RUN_FORBIDDEN;
|
||||
+ trainerClass = gTrainers[gTrainerBattleOpponent_A].trainerClass;
|
||||
+ switch (trainerClass)
|
||||
|
@ -217,7 +217,7 @@ void SwitchPartyOrder(u8 battler)
|
|||
&& gBattleBufferB[gActiveBattler][1] == B_ACTION_RUN)
|
||||
{
|
||||
- gBattleCommunication[gActiveBattler]++;
|
||||
+ if (IsTrainerCantRunFrom() || IsDoubleBattle())
|
||||
+ if (IsTrainerCantRunFrom())
|
||||
+ {
|
||||
+ BattleScriptExecute(BattleScript_PrintCantRunFromTrainer);
|
||||
+ gBattleCommunication[gActiveBattler] = STATE_BEFORE_ACTION_CHOSEN;
|
||||
|
|
Loading…
Reference in New Issue