From b0566f9ded4fc499df3f8a0f1519a888f58303a4 Mon Sep 17 00:00:00 2001 From: Zrips Date: Tue, 10 Jan 2017 15:32:20 +0200 Subject: [PATCH] We need to clone boost object --- com/gamingmesh/jobs/PlayerManager.java | 2 +- com/gamingmesh/jobs/container/BoostMultiplier.java | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/com/gamingmesh/jobs/PlayerManager.java b/com/gamingmesh/jobs/PlayerManager.java index 87744c08..dd8f6db8 100644 --- a/com/gamingmesh/jobs/PlayerManager.java +++ b/com/gamingmesh/jobs/PlayerManager.java @@ -663,7 +663,7 @@ public class PlayerManager { continue main; } - return oneItem.getBoost(); + return oneItem.getBoost().clone(); } return bonus; diff --git a/com/gamingmesh/jobs/container/BoostMultiplier.java b/com/gamingmesh/jobs/container/BoostMultiplier.java index 77e62052..60521417 100644 --- a/com/gamingmesh/jobs/container/BoostMultiplier.java +++ b/com/gamingmesh/jobs/container/BoostMultiplier.java @@ -6,6 +6,15 @@ public class BoostMultiplier { HashMap map = new HashMap(); + @Override + public BoostMultiplier clone() { + BoostMultiplier boost = new BoostMultiplier(); + for (CurrencyType type : CurrencyType.values()) { + boost.add(type, map.get(type)); + } + return boost; + } + public BoostMultiplier() { for (CurrencyType one : CurrencyType.values()) { map.put(one, 0D);