Add missing collision constant usage

This commit is contained in:
GriffinR
2022-01-29 21:13:46 -05:00
parent e30b16f0fd
commit 1ff0b0efa9
2 changed files with 8 additions and 9 deletions
+2 -3
View File
@@ -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;
}