summaryrefslogtreecommitdiff
path: root/src/trainer_see.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/trainer_see.c')
-rw-r--r--src/trainer_see.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/trainer_see.c b/src/trainer_see.c
index 07021a316..dc6c3b917 100644
--- a/src/trainer_see.c
+++ b/src/trainer_see.c
@@ -367,8 +367,6 @@ static u8 GetTrainerApproachDistanceEast(struct ObjectEvent *trainerObj, s16 ran
return 0;
}
-#define COLLISION_MASK (~1)
-
static u8 CheckPathBetweenTrainerAndPlayer(struct ObjectEvent *trainerObj, u8 approachDistance, u8 direction)
{
s16 x, y;
@@ -385,8 +383,9 @@ static u8 CheckPathBetweenTrainerAndPlayer(struct ObjectEvent *trainerObj, u8 ap
MoveCoords(direction, &x, &y);
for (i = 0; i < approachDistance - 1; i++, MoveCoords(direction, &x, &y))
{
+ // Check for collisions on approach, ignoring the "out of range" collision for regular movement
collision = GetCollisionFlagsAtCoords(trainerObj, x, y, direction);
- if (collision != 0 && (collision & COLLISION_MASK))
+ if (collision != 0 && (collision & ~(1 << (COLLISION_OUTSIDE_RANGE - 1))))
return 0;
}