Fix for disabled "bankEnabled" setting being ignored in some cases

Data is no longer stored for players with full power but not in a faction
This commit is contained in:
Brettflan 2011-12-18 01:33:34 -06:00
parent a9146ac27f
commit 54ba4473a2
3 changed files with 4 additions and 3 deletions

View File

@ -771,7 +771,7 @@ public class FPlayer extends PlayerEntity implements EconomyParticipator
double cost = Econ.calculateClaimCost(ownedLand, currentFaction.isNormal()); double cost = Econ.calculateClaimCost(ownedLand, currentFaction.isNormal());
//String costString = Econ.moneyString(cost); //String costString = Econ.moneyString(cost);
if(Conf.bankFactionPaysLandCosts && this.hasFaction()) if(Conf.bankEnabled && Conf.bankFactionPaysLandCosts && this.hasFaction())
{ {
Faction faction = this.getFaction(); Faction faction = this.getFaction();
if ( ! Econ.modifyMoney(faction, -cost, "to claim this land", "for claiming this land")) return false; if ( ! Econ.modifyMoney(faction, -cost, "to claim this land", "for claiming this land")) return false;
@ -809,6 +809,7 @@ public class FPlayer extends PlayerEntity implements EconomyParticipator
@Override @Override
public boolean shouldBeSaved() public boolean shouldBeSaved()
{ {
if (this.getPowerRounded() == this.getPowerMaxRounded() && !this.hasFaction()) return false;
return ! this.deleteMe; return ! this.deleteMe;
} }

View File

@ -106,7 +106,7 @@ public class CmdUnclaim extends FCommand
{ {
double refund = Econ.calculateClaimRefund(myFaction.getLandRounded()); 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; if ( ! Econ.modifyMoney(myFaction, refund, "to unclaim this land", "for unclaiming this land")) return;
} }

View File

@ -32,7 +32,7 @@ public class CmdUnclaimall extends FCommand
if (Econ.shouldBeUsed()) if (Econ.shouldBeUsed())
{ {
double refund = Econ.calculateTotalLandRefund(myFaction.getLandRounded()); 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; if ( ! Econ.modifyMoney(myFaction, refund, "to unclaim all faction land", "for unclaiming all faction land")) return;
} }