From 95bdac3d862921d6669b423018ce7b0e0045c68a Mon Sep 17 00:00:00 2001 From: Brettflan Date: Fri, 11 Nov 2011 13:10:18 -0600 Subject: [PATCH] Fix for command payment and land claiming/unclaiming payments not checking if faction banks are actually enabled, but instead only checking the individual bank-related settings; Fix for command costs being charged incorrectly based on "land costs" setting --- src/com/massivecraft/factions/FPlayer.java | 2 +- src/com/massivecraft/factions/cmd/CmdUnclaim.java | 2 +- src/com/massivecraft/factions/cmd/CmdUnclaimall.java | 2 +- src/com/massivecraft/factions/cmd/FCommand.java | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/com/massivecraft/factions/FPlayer.java b/src/com/massivecraft/factions/FPlayer.java index b38d40fc..a236c7fd 100644 --- a/src/com/massivecraft/factions/FPlayer.java +++ b/src/com/massivecraft/factions/FPlayer.java @@ -608,7 +608,7 @@ public class FPlayer extends PlayerEntity implements EconomyParticipator double cost = Econ.calculateClaimCost(ownedLand, currentFaction.isNormal()); //String costString = Econ.moneyString(cost); - if(Conf.bankFactionPaysLandCosts && this.hasFaction()) + if(Conf.bankEnabled && Conf.bankFactionPaysLandCosts && this.hasFaction()) { Faction faction = this.getFaction(); if ( ! Econ.modifyMoney(faction, -cost, "to claim this land", "for claiming this land")) return false; diff --git a/src/com/massivecraft/factions/cmd/CmdUnclaim.java b/src/com/massivecraft/factions/cmd/CmdUnclaim.java index 7594af08..1f3583c9 100644 --- a/src/com/massivecraft/factions/cmd/CmdUnclaim.java +++ b/src/com/massivecraft/factions/cmd/CmdUnclaim.java @@ -42,7 +42,7 @@ public class CmdUnclaim extends FCommand { double refund = Econ.calculateClaimRefund(myFaction.getLandRounded()); - if(Conf.bankFactionPaysLandCosts) + if(Conf.bankEnabled && Conf.bankFactionPaysLandCosts) { if ( ! Econ.modifyMoney(myFaction, refund, "to unclaim this land", "for unclaiming this land")) return; } diff --git a/src/com/massivecraft/factions/cmd/CmdUnclaimall.java b/src/com/massivecraft/factions/cmd/CmdUnclaimall.java index 49d2ea6f..c469190a 100644 --- a/src/com/massivecraft/factions/cmd/CmdUnclaimall.java +++ b/src/com/massivecraft/factions/cmd/CmdUnclaimall.java @@ -32,7 +32,7 @@ public class CmdUnclaimall extends FCommand if (Econ.shouldBeUsed()) { double refund = Econ.calculateTotalLandRefund(myFaction.getLandRounded()); - if(Conf.bankFactionPaysLandCosts) + if(Conf.bankEnabled && Conf.bankFactionPaysLandCosts) { if ( ! Econ.modifyMoney(myFaction, refund, "to unclaim all faction land", "for unclaiming all faction land")) return; } diff --git a/src/com/massivecraft/factions/cmd/FCommand.java b/src/com/massivecraft/factions/cmd/FCommand.java index bea6cf04..98c1e6a6 100644 --- a/src/com/massivecraft/factions/cmd/FCommand.java +++ b/src/com/massivecraft/factions/cmd/FCommand.java @@ -389,7 +389,7 @@ public abstract class FCommand extends MCommand

{ if ( ! Econ.shouldBeUsed() || this.fme == null || cost == 0.0 || fme.hasAdminMode()) return true; - if(Conf.bankFactionPaysLandCosts && fme.hasFaction()) + if(Conf.bankEnabled && Conf.bankFactionPaysCosts && fme.hasFaction()) { if ( ! Econ.modifyMoney(myFaction, -cost, toDoThis, forDoingThis)) return false; }