magefree / magefree/mage

Pyre of the World Tree cause NullPointerException on casting transformed

Open
#13,653 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
Java
Stars
2.4k
Forks
940
Avg merge
2d 12h
Merged PRs (30d)
160

Description

Something wrong with game data and there are possible cards without ownerId. Need research the real reason and reproduce it. Relates to combo with cost reduction effects like `SpellsCostReductionControllerEffect`. Example with [[Pyre of the World Tree]]

Stack: Cast Pyre of the World Tree using Transformed
Game error:
```
java.lang.NullPointerException
at mage.cards.Card.isOwnedBy(Card.java:258)
at mage.filter.predicate.other.SpellCastFromAnywhereOtherThanHand.apply(SpellCastFromAnywhereOtherThanHand.java:19)
at mage.filter.predicate.other.SpellCastFromAnywhereOtherThanHand.apply(SpellCastFromAnywhereOtherThanHand.java:10)
at mage.filter.FilterCard.lambda$match$0(FilterCard.java:68)
at java.util.stream.MatchOps$1MatchSink.accept(MatchOps.java:90)
at java.util.ArrayList$ArrayListSpliterator.tryAdvance(ArrayList.java:1361)
at java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:126)
at java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:499)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:486)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472)
at java.util.stream.MatchOps$MatchOp.evaluateSequential(MatchOps.java:230)
at java.util.stream.MatchOps$MatchOp.evaluateSequential(MatchOps.java:196)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.allMatch(ReferencePipeline.java:521)
at mage.filter.FilterCard.match(FilterCard.java:68)
at mage.abilities.effects.common.cost.SpellsCostReductionControllerEffect.applies(SpellsCostReductionControllerEffect.java:155)
at mage.abilities.effects.ContinuousEffects.costModification(ContinuousEffects.java:720)
at mage.abilities.AbilityImpl.activate(AbilityImpl.java:444)
at mage.abilities.ActivatedAbilityImpl.activate(ActivatedAbilityImpl.java:220)
at mage.abilities.common.SpellTransformedAbility.activate(SpellTransformedAbility.java:66)
at mage.game.stack.Spell.activate(Spell.java:167)
at mage.players.PlayerImpl.cast(PlayerImpl.java:1350)
at mage.abilities.common.SiegeDefeatedEffect.apply(SiegeAbility.java:110)
at mage.abilities.AbilityImpl.resolveMode(AbilityImpl.java:226)
at mage.abilities.AbilityImpl.resolve(AbilityImpl.java:210)
at mage.abilities.TriggeredAbilityImpl.resolve(TriggeredAbilityImpl.java:254)
at mage.game.stack.StackAbility.resolve(StackAbility.java:85)
at mage.game.GameImpl.resolve(GameImpl.java:1815)
at mage.game.GameImpl.playPriority(GameImpl.java:1738)
at mage.game.turn.Step.priority(Step.java:73)
at mage.game.turn.CombatDamageStep.priority(CombatDamageStep.java:37)
at mage.game.turn.Phase.playStep(Phase.java:205)
at mage.game.turn.Phase.play(Phase.java:91)
at mage.game.turn.Turn.play(Turn.java:129)
at mage.game.GameImpl.playTurn(GameImpl.java:1157)
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the transformed cast of Pyre of the World Tree with cost reduction effects, then follow the stack from Card.isOwnedBy through SpellCastFromAnywhereOtherThanHand and SpellsCostReductionControllerEffect. Inspect the transformed activation path in SpellTransformedAbility and related stack entries. Done means the underlying missing ownerId cause is identified and the cast no longer throws a NullPointerException.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
game-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.