* Proliferate - Fixed that in some cases permanents that had counters before could be choosen tp proliferate.

This commit is contained in:
LevelX2 2015-05-25 18:39:36 +02:00
parent 77def0a112
commit c71b3ea7e8
2 changed files with 50 additions and 2 deletions

View file

@ -57,7 +57,7 @@ public class Counters extends HashMap<String, Counter> implements Serializable {
this.put(name, new Counter(name));
}
this.get(name).add();
}
}
public void addCounter(String name, int amount) {
if (!this.containsKey(name)) {
@ -76,7 +76,11 @@ public class Counters extends HashMap<String, Counter> implements Serializable {
public void removeCounter(String name) {
if (this.containsKey(name)) {
this.get(name).remove();
Counter counter = this.get(name);
counter.remove();
if (counter.getCount() == 0) {
this.remove(name);
}
}
}