Fix non-aggressive targeting not stopping when within range of the target

This commit is contained in:
fullwall 2016-07-24 21:50:35 +08:00
parent 79a53b45a6
commit fa3fbe7be1

View File

@ -105,8 +105,9 @@ public class MCTargetStrategy implements PathStrategy, EntityTarget {
if (cancelReason != null) { if (cancelReason != null) {
return true; return true;
} }
if (!aggro && distanceSquared() < parameters.distanceMargin()) { if (!aggro && distanceSquared() <= parameters.distanceMargin()) {
stop(); stop();
return false;
} else if (updateCounter++ > parameters.updatePathRate()) { } else if (updateCounter++ > parameters.updatePathRate()) {
targetNavigator.setPath(); targetNavigator.setPath();
updateCounter = 0; updateCounter = 0;