Don't use Abs on Sqrt
This commit is contained in:
parent
aebfbba20e
commit
e529438c7e
@ -56,7 +56,7 @@ public class GoalNear implements Goal, IGoalRenderPos {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public double heuristic() {//TODO less hacky solution
|
public double heuristic() {//TODO less hacky solution
|
||||||
int range = (int)Math.ceil(Math.abs(Math.sqrt(rangeSq)));
|
int range = (int)Math.ceil(Math.sqrt(rangeSq));
|
||||||
HashSet<Double> maybeAlwaysInside = new HashSet<>();
|
HashSet<Double> maybeAlwaysInside = new HashSet<>();
|
||||||
HashSet<Double> sometimesOutside = new HashSet<>();
|
HashSet<Double> sometimesOutside = new HashSet<>();
|
||||||
for (int dx = -range; dx <= range; dx++) {
|
for (int dx = -range; dx <= range; dx++) {
|
||||||
|
@ -85,7 +85,7 @@ public class GoalRunAway implements Goal {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public double heuristic() {//TODO less hacky solution
|
public double heuristic() {//TODO less hacky solution
|
||||||
int distance = (int)Math.ceil(Math.abs(Math.sqrt(distanceSq)));
|
int distance = (int)Math.ceil(Math.sqrt(distanceSq));
|
||||||
int minX = from[0].getX() - distance;
|
int minX = from[0].getX() - distance;
|
||||||
int minY = from[0].getY() - distance;
|
int minY = from[0].getY() - distance;
|
||||||
int minZ = from[0].getZ() - distance;
|
int minZ = from[0].getZ() - distance;
|
||||||
|
Loading…
Reference in New Issue
Block a user