Update TokenEffectBase.java

fix ConcurrentModificationException (anointed procession and divine visitation in play, then cast benevolent offering, then choose replacement effect divine visitation, hit ok)
This commit is contained in:
Anthony Calosa
2023-03-26 10:45:13 +08:00
committed by GitHub
parent 67bc3e1f98
commit 2a0c36eaa1

View File

@@ -78,7 +78,7 @@ public abstract class TokenEffectBase extends SpellAbilityEffect {
// support PlayerCollection for affected
Set<Player> toRemove = Sets.newHashSet();
for (Player p : tokenTable.rowKeySet()) {
for (Player p : Sets.newHashSet(tokenTable.rowKeySet())) {
final Map<AbilityKey, Object> repParams = AbilityKey.mapFromAffected(p);
repParams.put(AbilityKey.Token, tokenTable);
repParams.put(AbilityKey.EffectOnly, true); // currently only effects can create tokens?