Fix shop updater (#236)

This commit is contained in:
ken_kentan 2019-01-15 00:24:57 +09:00 committed by Eric B
parent 6ae12f65c0
commit e532e9c095

View File

@ -380,9 +380,11 @@ public class ShopUtils {
double holoDistSqr = Math.pow(Config.maximalDistance, 2); double holoDistSqr = Math.pow(Config.maximalDistance, 2);
double itemDistSqr = Math.pow(Config.maximalItemDistance, 2); double itemDistSqr = Math.pow(Config.maximalItemDistance, 2);
Location playerLocation = p.getLocation();
for (Shop shop : getShops()) { for (Shop shop : getShops()) {
if (p.getLocation().getWorld().getName().equals(shop.getLocation().getWorld().getName())) { if (playerLocation.getWorld().getName().equals(shop.getLocation().getWorld().getName())) {
double distSqr = shop.getLocation().distanceSquared(p.getLocation()); double distSqr = shop.getLocation().distanceSquared(playerLocation);
if (shop.hasHologram()) { if (shop.hasHologram()) {
if (distSqr <= holoDistSqr) { if (distSqr <= holoDistSqr) {