mirror of
https://github.com/correl/mage.git
synced 2024-11-15 19:19:33 +00:00
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:
parent
ebd06f03c4
commit
bf59d850a8
2 changed files with 8 additions and 3 deletions
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue