mirror of
https://github.com/correl/mage.git
synced 2024-12-26 03:00:11 +00:00
Fixed removing counters
This commit is contained in:
parent
4f18e1ad71
commit
50fa28e81d
1 changed files with 3 additions and 0 deletions
|
@ -89,6 +89,9 @@ public class Counters extends HashMap<String, Counter> implements Serializable {
|
|||
public void removeCounter(String name, int amount) {
|
||||
if (this.containsKey(name)) {
|
||||
this.get(name).remove(amount);
|
||||
if (this.get(name).getCount() == 0) {
|
||||
this.remove(name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue