Some bugfixes

This commit is contained in:
Olof Larsson 2013-04-26 08:02:32 +02:00
parent 684974b336
commit f6d601446e
5 changed files with 14 additions and 14 deletions

View File

@ -23,6 +23,8 @@ import com.massivecraft.factions.cmd.*;
import com.massivecraft.factions.entity.Board;
import com.massivecraft.factions.entity.BoardColls;
import com.massivecraft.factions.entity.Faction;
import com.massivecraft.factions.entity.MPlayerColl;
import com.massivecraft.factions.entity.UConfColls;
import com.massivecraft.factions.entity.UPlayerColls;
import com.massivecraft.factions.entity.FactionColls;
import com.massivecraft.factions.entity.MConfColl;
@ -109,6 +111,8 @@ public class Factions extends MPlugin
// Initialize Database
this.databaseInitialized = false;
MConfColl.get().init();
MPlayerColl.get().init();
UConfColls.get().init();
UPlayerColls.get().init();
FactionColls.get().init();
BoardColls.get().init();

View File

@ -76,7 +76,8 @@ public class CmdFactionsShow extends FCommand
for (FactionsEventChunkChangeType type : FactionsEventChunkChangeType.values())
{
Double money = uconf.econChunkCost.get(type);
if (money == null) money = 0D;
if (money == null) continue;
if (money == 0D) continue;
money *= landCount;
String word = null;

View File

@ -31,11 +31,12 @@ public class ReqBankCommandsEnabled extends ReqAbstract
@Override
public String createErrorMessage(CommandSender sender, MCommand command)
{
if (!UConf.get(sender).bankEnabled)
UConf uconf = UConf.get(sender);
if (!uconf.bankEnabled)
{
return Txt.parse("<b>The Factions bank system is disabled on this server.");
return Txt.parse("<b>Faction banks are disabled in the <h>%s <b>universe.", uconf.getUniverse());
}
return Txt.parse("<b>The Factions economy features are disabled on this server.");
return Txt.parse("<b>Faction economy features are disabled in the <h>%s <b>universe.", uconf.getUniverse());
}
}

View File

@ -118,9 +118,6 @@ public class Econ
if ( ! canIControllYou(invoker, from)) return false;
// Is there enough money for the transaction to happen?
if (Money.get(from) < amount)
{
// There was not enough money to pay
@ -132,12 +129,9 @@ public class Econ
}
// Transfer money
if (Money.subtract(from, amount))
{
if (Money.add(from, amount))
if (Money.add(to, amount))
{
if (notify)
{
@ -254,7 +248,7 @@ public class Econ
}
else
{
ep.msg("<h>%s<i> lost <h>%s<i> since did %s.", You, Money.format(ep, delta), actionDescription);
ep.msg("<h>%s<i> lost <h>%s<i> since did %s.", You, Money.format(ep, -delta), actionDescription);
}
}
return true;
@ -269,7 +263,7 @@ public class Econ
}
else
{
ep.msg("<h>%s<i> can't afford <h>%s<i> to %s.", You, Money.format(ep, delta), actionDescription);
ep.msg("<h>%s<i> can't afford <h>%s<i> to %s.", You, Money.format(ep, -delta), actionDescription);
}
}
return false;

View File

@ -85,7 +85,7 @@ public class FactionsListenerEcon implements Listener
double amount = Money.get(faction);
String amountString = Money.format(faction, amount);
Econ.transferMoney(usender, faction, usender, amount, false);
Econ.transferMoney(usender, faction, usender, amount, true);
usender.msg("<i>You have been given the disbanded faction's bank, totaling %s.", amountString);
Factions.get().log(usender.getName() + " has been given bank holdings of "+amountString+" from disbanding "+faction.getName()+".");