Skip to content

Commit

Permalink
fix location.line_of_sight
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Sep 30, 2019
1 parent 2d91588 commit 4958058
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
Expand Up @@ -412,7 +412,11 @@ private static MovingObjectPosition rayTrace(World world, Vector start, Vector e

@Override
public boolean canTrace(World world, Vector start, Vector end) {
return rayTrace(world, start, end) == null;
MovingObjectPosition pos = rayTrace(world, start, end);
if (pos == null) {
return true;
}
return pos.type == MovingObjectPosition.EnumMovingObjectType.MISS;
}

@Override
Expand Down
Expand Up @@ -423,7 +423,11 @@ private static MovingObjectPosition rayTrace(World world, Vector start, Vector e

@Override
public boolean canTrace(World world, Vector start, Vector end) {
return rayTrace(world, start, end) == null;
MovingObjectPosition pos = rayTrace(world, start, end);
if (pos == null) {
return true;
}
return pos.type == MovingObjectPosition.EnumMovingObjectType.MISS;
}

@Override
Expand Down
Expand Up @@ -457,7 +457,11 @@ private static MovingObjectPosition rayTrace(World world, Vector start, Vector e

@Override
public boolean canTrace(World world, Vector start, Vector end) {
return rayTrace(world, start, end) == null;
MovingObjectPosition pos = rayTrace(world, start, end);
if (pos == null) {
return true;
}
return pos.getType() == MovingObjectPosition.EnumMovingObjectType.MISS;
}

@Override
Expand Down

0 comments on commit 4958058

Please sign in to comment.