Merge branch 'kalitasTokenEffectFix' into 'master'

TokenEffect: fix Cause Key it should be null in some cases

See merge request core-developers/forge!2221
This commit is contained in:
Hans Mackowiak
2019-10-06 13:21:38 +00:00
2 changed files with 5 additions and 5 deletions

View File

@@ -225,11 +225,8 @@ public class TokenEffect extends SpellAbilityEffect {
// Cause of the Token Effect, in general it should be this
// but if its a Replacement Effect, it might be something else or null
SpellAbility cause = sa;
if (root.isReplacementAbility()) {
Object replacingObject = root.getReplacingObject(AbilityKey.Cause);
if (replacingObject != null) {
cause = (SpellAbility) replacingObject;
}
if (root.isReplacementAbility() && root.hasReplacingObject(AbilityKey.Cause)) {
cause = (SpellAbility) root.getReplacingObject(AbilityKey.Cause);
}
final boolean remember = sa.hasParam("RememberTokens");

View File

@@ -596,6 +596,9 @@ public abstract class SpellAbility extends CardTraitBase implements ISpellAbilit
public Map<AbilityKey, Object> getReplacingObjects() {
return replacingObjects;
}
public boolean hasReplacingObject(final AbilityKey type) {
return replacingObjects.containsKey(type);
}
public Object getReplacingObject(final AbilityKey type) {
final Object res = replacingObjects.get(type);
return res;