mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 19:58:00 +00:00
Make yield string methods robust to effects that don't have a host card
This commit is contained in:
@@ -581,9 +581,13 @@ public abstract class SpellAbility extends CardTraitBase implements ISpellAbilit
|
||||
}
|
||||
}
|
||||
|
||||
// key for autoyield - the card description (including number) plus the effect description
|
||||
// key for autoyield - the card description (including number) (if there is a card) plus the effect description
|
||||
public String yieldKey() {
|
||||
return getHostCard().toString() + ": " + toUnsuppressedString();
|
||||
if ( getHostCard() != null ) {
|
||||
return getHostCard().toString() + ": " + toUnsuppressedString();
|
||||
} else {
|
||||
return toUnsuppressedString();
|
||||
}
|
||||
}
|
||||
|
||||
public String getStackDescription() {
|
||||
|
||||
@@ -193,7 +193,11 @@ public class WrappedAbility extends Ability {
|
||||
@Override
|
||||
public String yieldKey() {
|
||||
if ( getTrigger() != null ) {
|
||||
return getHostCard().toString() + ": " + getTrigger().toString();
|
||||
if ( getHostCard() != null ) {
|
||||
return getHostCard().toString() + ": " + getTrigger().toString();
|
||||
} else {
|
||||
return getTrigger().toString();
|
||||
}
|
||||
} else {
|
||||
return super.yieldKey();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user