I can't count + fix variable scope

This commit is contained in:
Jesse Boyd 2016-06-18 13:54:35 +10:00
parent 29ce4af350
commit 6375922808
2 changed files with 4 additions and 2 deletions

View File

@ -74,7 +74,9 @@ public class Merge extends SubCommand {
final PlotArea plotArea = plot.getArea();
Expression<Double> priceExr = plotArea.PRICES.containsKey("merge") ? plotArea.PRICES.get("merge") : null;
final int size = plot.getConnectedPlots().size();
double price = priceExr == null ? 0d : priceExr.evalute((double) size);
System.out.println("EXPRESSIONL " + priceExr);
final double price = priceExr == null ? 0d : priceExr.evalute((double) size);
System.out.println("PRICE: " + price + " | " + EconHandler.manager + " | " + plotArea.USE_ECONOMY);
if (EconHandler.manager != null && plotArea.USE_ECONOMY && price > 0d && EconHandler.manager.getMoney(player) < price) {
sendMessage(player, C.CANNOT_AFFORD_MERGE, String.valueOf(price));
return false;

View File

@ -32,7 +32,7 @@ public abstract class Expression<T> {
} catch (Exception ignore) {}
if (expression.endsWith("*{arg}")) {
try {
return linearDouble(Double.parseDouble(expression.substring(0, expression.length() - 8)));
return linearDouble(Double.parseDouble(expression.substring(0, expression.length() - 6)));
} catch (Exception ignore) {}
}
return new Expression<Double>() {