Fixed a bug that the copy of a Token could no more be copied because the baseValues for P/T were 0 for this copy. E.g. populate on an already populated token failed because of this bug.

This commit is contained in:
LevelX2 2013-01-16 14:14:34 +01:00
parent ebd06f03c4
commit bf59d850a8
2 changed files with 8 additions and 3 deletions

View file

@ -72,6 +72,11 @@ public class MageInt implements Serializable, Copyable<MageInt> {
return baseValue;
}
public void initValue(int value) {
this.baseValue = value;
this.cardValue = Integer.toString(value);
}
public void setValue(int value) {
this.baseValue = value;
}

View file

@ -75,9 +75,9 @@ public class CopyTokenFunction implements Function<Token, Card> {
ability.setSourceId(target.getId());
target.addAbility(ability);
}
// Needed to do it this way because else the increased value from cards like "Intangible Virtue" will be copied.
target.getPower().setValue(Integer.parseInt(source.getPower().toString()));
target.getToughness().setValue(Integer.parseInt(source.getToughness().toString()));
// Needed to do it this way because only the cardValue does not include the increased value from cards like "Intangible Virtue" will be copied.
target.getPower().initValue(Integer.parseInt(source.getPower().toString()));
target.getToughness().initValue(Integer.parseInt(source.getToughness().toString()));
return target;
}