Targeting bug with copySpellontoStack
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Agetian, friarsol, Blacksmith, KrazyTheFox, CCGHQ Admins
6 posts
• Page 1 of 1
Targeting bug with copySpellontoStack
by Sloth » 02 Feb 2012, 16:12
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?
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?
-

Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: Targeting bug with copySpellontoStack
by friarsol » 02 Feb 2012, 16:35
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.
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Targeting bug with copySpellontoStack
by Sloth » 02 Feb 2012, 17:57
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).
Also the spells copied with Replicate work as expected now. Unfortunately the original spell with Replicate doesn't (it still loses its target).
-

Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: Targeting bug with copySpellontoStack
by Chris H. » 02 Feb 2012, 18:11
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 can hold off the beta release until Monday if you need some more time for testing.
-

Chris H. - Forge Moderator
- Posts: 6320
- Joined: 04 Nov 2008, 12:11
- Location: Mac OS X Yosemite
- Has thanked: 644 times
- Been thanked: 643 times
Re: Targeting bug with copySpellontoStack
by Sloth » 02 Feb 2012, 18:41
I don't think that's needed. It mostly affected stuff that was broken anyway.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'm actually planning AF Play now and i would be more confident to release it after a beta.
-

Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: Targeting bug with copySpellontoStack
by Chris H. » 02 Feb 2012, 20:14
`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.
-

Chris H. - Forge Moderator
- Posts: 6320
- Joined: 04 Nov 2008, 12:11
- Location: Mac OS X Yosemite
- Has thanked: 644 times
- Been thanked: 643 times
6 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 11 guests