mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 20:58:03 +00:00
TokenEffect: fix Cause Key it should be null in some cases
This commit is contained in:
@@ -225,11 +225,8 @@ public class TokenEffect extends SpellAbilityEffect {
|
|||||||
// Cause of the Token Effect, in general it should be this
|
// Cause of the Token Effect, in general it should be this
|
||||||
// but if its a Replacement Effect, it might be something else or null
|
// but if its a Replacement Effect, it might be something else or null
|
||||||
SpellAbility cause = sa;
|
SpellAbility cause = sa;
|
||||||
if (root.isReplacementAbility()) {
|
if (root.isReplacementAbility() && root.hasReplacingObject(AbilityKey.Cause)) {
|
||||||
Object replacingObject = root.getReplacingObject(AbilityKey.Cause);
|
cause = (SpellAbility) root.getReplacingObject(AbilityKey.Cause);
|
||||||
if (replacingObject != null) {
|
|
||||||
cause = (SpellAbility) replacingObject;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
final boolean remember = sa.hasParam("RememberTokens");
|
final boolean remember = sa.hasParam("RememberTokens");
|
||||||
|
|||||||
@@ -596,6 +596,9 @@ public abstract class SpellAbility extends CardTraitBase implements ISpellAbilit
|
|||||||
public Map<AbilityKey, Object> getReplacingObjects() {
|
public Map<AbilityKey, Object> getReplacingObjects() {
|
||||||
return replacingObjects;
|
return replacingObjects;
|
||||||
}
|
}
|
||||||
|
public boolean hasReplacingObject(final AbilityKey type) {
|
||||||
|
return replacingObjects.containsKey(type);
|
||||||
|
}
|
||||||
public Object getReplacingObject(final AbilityKey type) {
|
public Object getReplacingObject(final AbilityKey type) {
|
||||||
final Object res = replacingObjects.get(type);
|
final Object res = replacingObjects.get(type);
|
||||||
return res;
|
return res;
|
||||||
|
|||||||
Reference in New Issue
Block a user