Correct calculating the plot price, if 'merge' differs from 'claim'

This commit is contained in:
Alexander Brandes 2023-06-23 10:40:40 +02:00
parent f3c03348d9
commit af32399dd2
No known key found for this signature in database
GPG Key ID: 158F5701A6AAD00C

View File

@ -298,7 +298,7 @@ public class Auto extends SubCommand {
PlotExpression costExp = plotarea.getPrices().get("claim"); PlotExpression costExp = plotarea.getPrices().get("claim");
PlotExpression mergeCostExp = plotarea.getPrices().get("merge"); PlotExpression mergeCostExp = plotarea.getPrices().get("merge");
int size = sizeX * sizeZ; int size = sizeX * sizeZ;
double mergeCost = size > 1 && mergeCostExp == null ? 0d : mergeCostExp.evaluate(size); double mergeCost = size <= 1 || mergeCostExp == null ? 0d : mergeCostExp.evaluate(size);
double cost = costExp.evaluate(Settings.Limit.GLOBAL ? double cost = costExp.evaluate(Settings.Limit.GLOBAL ?
player.getPlotCount() : player.getPlotCount() :
player.getPlotCount(plotarea.getWorldName())); player.getPlotCount(plotarea.getWorldName()));