From efa9d6cb592d4c0e543114847785ab3ac3f4eecd Mon Sep 17 00:00:00 2001 From: Olof Larsson Date: Tue, 3 Dec 2013 18:02:15 +0100 Subject: [PATCH] Treat a move as a move instead of a despawn+spawn. --- .../factions/integration/Econ.java | 29 +++++++------------ 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/src/com/massivecraft/factions/integration/Econ.java b/src/com/massivecraft/factions/integration/Econ.java index 421ea125..b80b5006 100644 --- a/src/com/massivecraft/factions/integration/Econ.java +++ b/src/com/massivecraft/factions/integration/Econ.java @@ -133,30 +133,23 @@ public class Econ } // Transfer money - if (Money.despawn(amount, null, from)) + if (Money.move(amount, invoker, from, to)) { - if (Money.spawn(amount, null, to)) + if (notify) { - if (notify) - { - sendTransferInfo(invoker, from, to, amount); - } - return true; - } - else - { - // We failed. Try a rollback - Money.spawn(amount, null, from); + sendTransferInfo(invoker, from, to, amount); } + return true; } - - // if we get here something with the transaction failed - if (notify) + else { - invoker.msg("Unable to transfer %s to %s from %s.", Money.format(amount), to.describeTo(invoker), from.describeTo(invoker, true)); + // if we get here something with the transaction failed + if (invoker != null && notify) + { + invoker.msg("Unable to transfer %s to %s from %s.", Money.format(amount), to.describeTo(invoker), from.describeTo(invoker, true)); + } + return false; } - - return false; } public static Set getUPlayers(EconomyParticipator ep)