Page 1 of 1

Targeting bug with copySpellontoStack

PostPosted: 02 Feb 2012, 16:12
by Sloth
I finally found some time to look at the targeting bug with AF CopySpell (which includes Storm) and Replicate. At the moment the targets of all copies will be changed to the first target during their journey through the stack.

Looking at copySpellontoStack the error is clear:
The SpellAbility is cloned but it still has a pointer to the same target class, which makes storing different targets impossible. I made the changes needed to give the copied SpellAbility its own target class.

The real problem is showing now:
For some reason a lot of the ability factories use "af.getAbTgt()" to grab their targets and the AF is still pointing to the old shared Target class. Is there any reason for this?

I would gladly change all of them to use "sa.getTarget()" instead (which about 50% of the AF's already use). See any problems with this?

Re: Targeting bug with copySpellontoStack

PostPosted: 02 Feb 2012, 16:35
by friarsol
Sounds right to me. The AbilityFactory has nothing to do with the Targets, just for creation of the SAs. Thanks for spending the time to track this down Sloth.

Re: Targeting bug with copySpellontoStack

PostPosted: 02 Feb 2012, 17:57
by Sloth
I did a lot of testing and AF CopySpell seems fixed (i tried Temporal Fissure, Reaping the Graves and several cards with the effect of Chandra, the Firebrand).

Also the spells copied with Replicate work as expected now. Unfortunately the original spell with Replicate doesn't (it still loses its target).

Re: Targeting bug with copySpellontoStack

PostPosted: 02 Feb 2012, 18:11
by Chris H.
Thank you for trying to fix this issue. Do you need this upcoming weekend to finish?

I can hold off the beta release until Monday if you need some more time for testing.

Re: Targeting bug with copySpellontoStack

PostPosted: 02 Feb 2012, 18:41
by Sloth
Chris H. wrote:Thank you for trying to fix this issue. Do you need this upcoming weekend to finish?

I can hold off the beta release until Monday if you need some more time for testing.
I don't think that's needed. It mostly affected stuff that was broken anyway.

I'm actually planning AF Play now and i would be more confident to release it after a beta.

Re: Targeting bug with copySpellontoStack

PostPosted: 02 Feb 2012, 20:14
by Chris H.
Sloth wrote:I don't think that's needed. It mostly affected stuff that was broken anyway.
`
Thank you Sloth.

I will go ahead and release the next beta tomorrow.