Some of the bugs are fixed.

This commit is contained in:
Olof Larsson
2011-10-12 18:48:47 +02:00
parent 2566edfd8c
commit f25daa228a
25 changed files with 132 additions and 105 deletions

View File

@@ -113,9 +113,19 @@ public class Faction extends Entity implements EconomyParticipator
// FIELD: account (fake field)
// Bank functions
public double money; // Deprecated TODO: Hantera.
public String getAccountId() { return "faction-"+this.getId(); }
public MethodAccount getAccount()
{
return Econ.getMethod().getAccount("faction-"+this.getId());
String aid = this.getAccountId();
// We need to override the default money given to players.
if ( ! Econ.getMethod().hasAccount(aid))
{
MethodAccount acc = Econ.getMethod().getAccount(aid);
acc.set(0);
}
return Econ.getMethod().getAccount(aid);
}
/*public double getMoney() { return this.money; }
@@ -727,6 +737,13 @@ public class Faction extends Entity implements EconomyParticipator
@Override
public void postDetach()
{
if (Econ.shouldBeUsed())
{
Econ.getMethod().getAccount(getAccountId()).remove();
}
this.getAccountId();
// Clean the board
Board.clean();