fix convert command to take initial balance into account.

This commit is contained in:
Nick Minkler 2014-12-18 16:27:35 -08:00
parent cc0e8d5131
commit 18377681e0
2 changed files with 8 additions and 2 deletions

View File

@ -12,7 +12,7 @@
<!-- Project information -->
<groupId>net.milkbowl.vault</groupId>
<artifactId>Vault</artifactId>
<version>${api.version}.1</version>
<version>${api.version}.2</version>
<name>Vault</name>
<url>http://dev.bukkit.org/server-mods/vault/</url>
<description>Vault is a Permissions &amp; Economy API to allow plugins to more easily hook into these systems without needing to hook each individual system themselves.

View File

@ -462,7 +462,13 @@ public class Vault extends JavaPlugin {
continue;
}
econ2.createPlayerAccount(op);
econ2.depositPlayer(op, econ1.getBalance(op));
double diff = econ1.getBalance(op) - econ2.getBalance(op);
if (diff > 0) {
econ2.depositPlayer(op, diff);
} else if (diff < 0) {
econ2.withdrawPlayer(op, -diff);
}
}
}
sender.sendMessage("Converson complete, please verify the data before using it.");