From 26e16be7724011356369861862d6df9922400f6e Mon Sep 17 00:00:00 2001 From: ingmargoudt Date: Mon, 13 Feb 2017 21:45:37 +0100 Subject: [PATCH] fix counters --- Mage/src/main/java/mage/counters/Counters.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Mage/src/main/java/mage/counters/Counters.java b/Mage/src/main/java/mage/counters/Counters.java index 6adbc3aa3d..93667bcb35 100644 --- a/Mage/src/main/java/mage/counters/Counters.java +++ b/Mage/src/main/java/mage/counters/Counters.java @@ -57,8 +57,12 @@ public class Counters extends HashMap implements Serializable { } public void addCounter(Counter counter) { - putIfAbsent(counter.name, counter); - get(counter.name).add(counter.getCount()); + if (!containsKey(counter.name)) { + put(counter.name, counter); + } else { + + get(counter.name).add(counter.getCount()); + } }