mirror of
https://github.com/correl/mage.git
synced 2024-11-16 03:00:12 +00:00
Fixed a problem, that images of copied tokens were not shown.
This commit is contained in:
parent
2a8e21fdb7
commit
3b8a75588b
2 changed files with 9 additions and 2 deletions
|
@ -88,6 +88,9 @@ public class Token extends MageObjectImpl<Token> {
|
||||||
super(token);
|
super(token);
|
||||||
this.description = token.description;
|
this.description = token.description;
|
||||||
this.tokenType = token.tokenType;
|
this.tokenType = token.tokenType;
|
||||||
|
this.lastAddedTokenId = token.lastAddedTokenId;
|
||||||
|
this.originalCardNumber = token.originalCardNumber;
|
||||||
|
this.originalExpansionSetCode = token.originalExpansionSetCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getDescription() {
|
public String getDescription() {
|
||||||
|
|
|
@ -59,8 +59,13 @@ public class CopyTokenFunction implements Function<Token, Card> {
|
||||||
MageObject sourceObj = source;
|
MageObject sourceObj = source;
|
||||||
if (source instanceof PermanentToken) {
|
if (source instanceof PermanentToken) {
|
||||||
sourceObj = ((PermanentToken) source).getToken();
|
sourceObj = ((PermanentToken) source).getToken();
|
||||||
|
// to show the source image, the original values have to be used
|
||||||
|
target.setOriginalExpansionSetCode(((Token)sourceObj).getOriginalExpansionSetCode());
|
||||||
|
target.setOriginalCardNumber(((Token)sourceObj).getOriginalCardNumber());
|
||||||
} else if (source instanceof PermanentCard) {
|
} else if (source instanceof PermanentCard) {
|
||||||
sourceObj = ((PermanentCard) source).getCard();
|
sourceObj = ((PermanentCard) source).getCard();
|
||||||
|
target.setOriginalExpansionSetCode(source.getExpansionSetCode());
|
||||||
|
target.setOriginalCardNumber(source.getCardNumber());
|
||||||
}
|
}
|
||||||
|
|
||||||
target.setName(sourceObj.getName());
|
target.setName(sourceObj.getName());
|
||||||
|
@ -79,8 +84,7 @@ public class CopyTokenFunction implements Function<Token, Card> {
|
||||||
for (String type : sourceObj.getSupertype()) {
|
for (String type : sourceObj.getSupertype()) {
|
||||||
target.getSupertype().add(type);
|
target.getSupertype().add(type);
|
||||||
}
|
}
|
||||||
target.setOriginalExpansionSetCode(source.getExpansionSetCode());
|
|
||||||
target.setOriginalCardNumber(source.getCardNumber());
|
|
||||||
target.getAbilities().clear();
|
target.getAbilities().clear();
|
||||||
|
|
||||||
for (Ability ability0 : sourceObj.getAbilities()) {
|
for (Ability ability0 : sourceObj.getAbilities()) {
|
||||||
|
|
Loading…
Reference in a new issue