From 1d3ded62f68d74c7c9a7ea62b93e317f873acf10 Mon Sep 17 00:00:00 2001 From: nathank33 Date: Thu, 29 Jan 2015 23:45:57 -0800 Subject: [PATCH] EarthSmash: Fixed an error when checking distances --- .../projectkorra/ProjectKorra/earthbending/EarthSmash.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/com/projectkorra/ProjectKorra/earthbending/EarthSmash.java b/src/com/projectkorra/ProjectKorra/earthbending/EarthSmash.java index 9b3d8678..ed07ffd5 100644 --- a/src/com/projectkorra/ProjectKorra/earthbending/EarthSmash.java +++ b/src/com/projectkorra/ProjectKorra/earthbending/EarthSmash.java @@ -545,9 +545,12 @@ public class EarthSmash { for(EarthSmash smash : instances) { //Check to see if the player is standing on top of the smash. - if(smash.state == State.LIFTED) - if(smash.loc.clone().add(0,2,0).distanceSquared(player.getLocation()) <= Math.pow(FLIGHT_DETECTION_RADIUS, 2)) + if(smash.state == State.LIFTED) { + if(smash.loc.getWorld().equals(player.getWorld()) + && smash.loc.clone().add(0,2,0).distanceSquared(player.getLocation()) <= Math.pow(FLIGHT_DETECTION_RADIUS, 2)) { return smash; + } + } } return null; }