summaryrefslogtreecommitdiff
path: root/src/battle_setup.c
diff options
context:
space:
mode:
authorluckytyphlosion <10688458+luckytyphlosion@users.noreply.github.com>2021-05-23 10:51:26 -0400
committerluckytyphlosion <10688458+luckytyphlosion@users.noreply.github.com>2021-05-23 10:51:26 -0400
commitc723d980e772f7e7ab82dbcb7ad07132c09ab5b4 (patch)
tree0bed002b2990b9e837220618a321f3b6517a1099 /src/battle_setup.c
parentc50a21fba07db80ac44c6f09fd202ba4b2e2c7d3 (diff)
parentffbbc88801de3fc56d0bf5f0af1418ca7cfcfa4f (diff)
Merge branch 'master' of https://github.com/pret/pokeemerald
Diffstat (limited to 'src/battle_setup.c')
-rw-r--r--src/battle_setup.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/battle_setup.c b/src/battle_setup.c
index 40b5993f0..cb65d25d6 100644
--- a/src/battle_setup.c
+++ b/src/battle_setup.c
@@ -607,7 +607,7 @@ static void CB2_EndWildBattle(void)
else
{
SetMainCallback2(CB2_ReturnToField);
- gFieldCallback = sub_80AF6F0;
+ gFieldCallback = FieldCB_ReturnToFieldNoScriptCheckMusic;
}
}
@@ -1197,7 +1197,7 @@ void ConfigureAndSetUpOneTrainerBattle(u8 trainerObjEventId, const u8 *trainerSc
gSelectedObjectEvent = trainerObjEventId;
gSpecialVar_LastTalked = gObjectEvents[trainerObjEventId].localId;
BattleSetup_ConfigureTrainerBattle(trainerScript + 1);
- ScriptContext1_SetupScript(EventScript_271354);
+ ScriptContext1_SetupScript(EventScript_StartTrainerApproach);
ScriptContext2_Enable();
}
@@ -1210,7 +1210,7 @@ void ConfigureTwoTrainersBattle(u8 trainerObjEventId, const u8 *trainerScript)
void SetUpTwoTrainersBattle(void)
{
- ScriptContext1_SetupScript(EventScript_271354);
+ ScriptContext1_SetupScript(EventScript_StartTrainerApproach);
ScriptContext2_Enable();
}
@@ -1220,10 +1220,12 @@ bool32 GetTrainerFlagFromScriptPointer(const u8 *data)
return FlagGet(TRAINER_FLAGS_START + flag);
}
-void SetUpTrainerMovement(void)
+// Set trainer's movement type so they stop and remain facing that direction
+// Note: Only for trainers who are spoken to directly
+// For trainers who spot the player this is handled by PlayerFaceApproachingTrainer
+void SetTrainerFacingDirection(void)
{
struct ObjectEvent *objectEvent = &gObjectEvents[gSelectedObjectEvent];
-
SetTrainerMovementType(objectEvent, GetTrainerFacingDirectionMovementType(objectEvent->facingDirection));
}
@@ -1437,7 +1439,7 @@ void ShowTrainerCantBattleSpeech(void)
ShowFieldMessage(GetTrainerCantBattleSpeech());
}
-void SetUpTrainerEncounterMusic(void)
+void PlayTrainerEncounterMusic(void)
{
u16 trainerId;
u16 music;