Fixed calculating party bonus XP when players are in different

worlds throwing errors.
This commit is contained in:
GJ 2012-04-01 16:30:16 -04:00
parent b0fbaa71bf
commit 6a858dace7

View File

@ -157,7 +157,11 @@ public class m {
* @return true if the distance between <code>first</code> and <code>second</code> is less than <code>maxDistance</code>, false otherwise * @return true if the distance between <code>first</code> and <code>second</code> is less than <code>maxDistance</code>, false otherwise
*/ */
public static boolean isNear(Location first, Location second, double maxDistance) { public static boolean isNear(Location first, Location second, double maxDistance) {
if (first.distance(second) < maxDistance) { if (!first.getWorld().equals(second.getWorld())) {
return false;
}
if (first.distanceSquared(second) < (maxDistance * maxDistance)) {
return true; return true;
} }
else { else {