Skip to content

Commit

Permalink
Fixed a crash with Operator: Closest to Point.
Browse files Browse the repository at this point in the history
  • Loading branch information
Vazkii committed Feb 14, 2016
1 parent fc084b6 commit 3cc99ea
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ public Object execute(SpellContext context) throws SpellRuntimeException {
double closest = Double.MAX_VALUE;
Entity closestEntity = null;
for(Entity e : listVal) {
if(e == null)
continue;

double dist = MathHelper.pointDistanceSpace(positionVal.x, positionVal.y, positionVal.z, e.posX, e.posY, e.posZ);
if(dist < closest) {
closest = dist;
Expand Down

0 comments on commit 3cc99ea

Please sign in to comment.