Skip to content

Commit

Permalink
Prepare a more strict fight.direction check.
Browse files Browse the repository at this point in the history
  • Loading branch information
asofold committed Jun 20, 2016
1 parent d8e8ecd commit 2c614cc
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -168,7 +168,7 @@ public boolean loopCheck(final Player player, final Location loc, final Entity d
off = TrigUtil.directionCheck(loc, player.getEyeHeight(), context.direction, dLoc.getX(), dLoc.getY() + damagedBoxMarginVertical / 2D, dLoc.getZ(), damagedBoxMarginHorizontal * 2.0, damagedBoxMarginVertical, TrigUtil.DIRECTION_LOOP_PRECISION);
}

if (off > 0.1) {
if (off > 0.11) {
// Player failed the check. Let's try to guess how far they were from looking directly to the entity...
final Vector blockEyes = new Vector(dLoc.getX() - loc.getX(), dLoc.getY() + damagedBoxMarginVertical / 2D - loc.getY() - player.getEyeHeight(), dLoc.getZ() - loc.getZ());
final double distance = blockEyes.crossProduct(context.direction).length() / context.lengthDirection;
Expand Down

0 comments on commit 2c614cc

Please sign in to comment.