mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 12:18:00 +00:00
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:
@@ -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");
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user