Fixed game error for few cards like Agent's Toolkit (fix NotSerializableException, #9580);

This commit is contained in:
Oleg Agafonov 2023-04-01 18:52:31 +04:00
parent 4bf3e43da6
commit ad3b76dae6
3 changed files with 6 additions and 3 deletions

View file

@ -14,6 +14,7 @@ import mage.players.Player;
import mage.util.RandomUtil;
import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.Set;
import java.util.UUID;
@ -58,7 +59,7 @@ public class RemoveCountersSourceCost extends CostImpl {
}
String toRemove;
if (name.isEmpty()) {
Set<String> toChoose = permanent.getCounters(game).keySet();
Set<String> toChoose = new LinkedHashSet<>(permanent.getCounters(game).keySet());
switch (toChoose.size()) {
case 0:
return paid;