diff options
author | GriffinR <griffin.g.richards@gmail.com> | 2022-02-11 19:52:26 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-11 19:52:26 -0500 |
commit | 8d85ff1683437897cb0c06dd84fa2d927f560090 (patch) | |
tree | dcce7deebadf4e3cc6d0bd35cadb7dd96469f7fe /src/trainer_see.c | |
parent | 91076d9408ecf7546cae522b014ead6f31f7a9dd (diff) | |
parent | 2598b285bb7383475c264c6bec391c676708bc8e (diff) |
Merge pull request #487 from GriffinRichards/trainer-type-constants
Add missing trainer type constant usage
Diffstat (limited to 'src/trainer_see.c')
-rw-r--r-- | src/trainer_see.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/trainer_see.c b/src/trainer_see.c index 904b8725c..d1c97e9af 100644 --- a/src/trainer_see.c +++ b/src/trainer_see.c @@ -10,6 +10,7 @@ #include "constants/battle_setup.h" #include "constants/event_object_movement.h" #include "constants/event_objects.h" +#include "constants/trainer_types.h" typedef u8 (*TrainerApproachFunc)(struct ObjectEvent *, s16, s16, s16); typedef bool8 (*TrainerSeeFunc)(u8, struct Task *, struct ObjectEvent *); @@ -93,12 +94,9 @@ bool8 CheckForTrainersWantingBattle(void) for (i = 0; i < OBJECT_EVENTS_COUNT; i++) { if (gObjectEvents[i].active - && ( - gObjectEvents[i].trainerType == 1 - || gObjectEvents[i].trainerType == 3 - ) - && CheckTrainer(i) - ) + && (gObjectEvents[i].trainerType == TRAINER_TYPE_NORMAL + || gObjectEvents[i].trainerType == TRAINER_TYPE_BURIED) + && CheckTrainer(i)) return TRUE; } return FALSE; @@ -129,12 +127,12 @@ static u8 GetTrainerApproachDistance(struct ObjectEvent *trainerObj) u8 approachDistance; PlayerGetDestCoords(&x, &y); - if (trainerObj->trainerType == 1) // can only see in one direction + if (trainerObj->trainerType == TRAINER_TYPE_NORMAL) // can only see in one direction { approachDistance = sDirectionalApproachDistanceFuncs[trainerObj->facingDirection - 1](trainerObj, trainerObj->trainerRange_berryTreeId, x, y); return CheckPathBetweenTrainerAndPlayer(trainerObj, approachDistance, trainerObj->facingDirection); } - else // can see in all directions + else // TRAINER_TYPE_SEE_ALL_DIRECTIONS, TRAINER_TYPE_BURIED { for (i = 0; i < 4; i++) { |