From 33e1d7749b27a83b0cf42038ccf86d286de22965 Mon Sep 17 00:00:00 2001 From: daviga404 Date: Wed, 17 Feb 2016 16:55:22 +0000 Subject: [PATCH] Check for zero money on faction disband The takeOnDisband method of EngineEcon now checks if the amount of money to be transferred to the player upon disbanding a faction is 0. If this is the case, the method exits. This will prevent unnecessary operations in transferring money to players (which could be expensive if the economy is hooked to a database, for example). --- src/com/massivecraft/factions/engine/EngineEcon.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/com/massivecraft/factions/engine/EngineEcon.java b/src/com/massivecraft/factions/engine/EngineEcon.java index d5c4e049..25ac420f 100644 --- a/src/com/massivecraft/factions/engine/EngineEcon.java +++ b/src/com/massivecraft/factions/engine/EngineEcon.java @@ -82,6 +82,10 @@ public class EngineEcon extends Engine Faction faction = event.getFaction(); double amount = Money.get(faction); + + // Check that there is an amount + if (amount == 0) return; + String amountString = Money.format(amount); Econ.transferMoney(faction, mplayer, mplayer, amount, true);