Check if you can see target before acquiring it.

This commit is contained in:
MobiusDevelopment 2019-10-10 22:51:52 +00:00
parent b5b22f8a89
commit 572de5974c
2 changed files with 2 additions and 0 deletions

View File

@ -14124,6 +14124,7 @@ public class PlayerInstance extends Playable
}
// Check if monster is reachable.
if (nearby.isAutoAttackable(this) //
&& GeoEngine.getInstance().canSeeTarget(this, nearby)//
&& GeoEngine.getInstance().canMoveToTarget(getX(), getY(), getZ(), nearby.getX(), nearby.getY(), nearby.getZ(), getInstanceWorld()))
{
final double monsterDistance = calculateDistance2D(nearby);

View File

@ -14073,6 +14073,7 @@ public class PlayerInstance extends Playable
}
// Check if monster is reachable.
if (nearby.isAutoAttackable(this) //
&& GeoEngine.getInstance().canSeeTarget(this, nearby)//
&& GeoEngine.getInstance().canMoveToTarget(getX(), getY(), getZ(), nearby.getX(), nearby.getY(), nearby.getZ(), getInstanceWorld()))
{
final double monsterDistance = calculateDistance2D(nearby);