prevent multiple singleton abilities on a permanent

This commit is contained in:
BetaSteward 2011-10-15 23:43:32 -04:00
parent 6fb8ecbf81
commit 4fc38b4548

View file

@ -167,9 +167,11 @@ public abstract class PermanentImpl<T extends PermanentImpl<T>> extends CardImpl
@Override
public void addAbility(Ability ability) {
Ability copy = ability.copy();
copy.setControllerId(controllerId);
copy.setSourceId(objectId);
abilities.add(copy);
if (!abilities.containsKey(copy.getId())) {
copy.setControllerId(controllerId);
copy.setSourceId(objectId);
abilities.add(copy);
}
}
@Override