It is currently 29 Oct 2025, 12:35
   
Text Size

Targeting bug with copySpellontoStack

Post MTG Forge Related Programming Questions Here

Moderators: timmermac, Agetian, friarsol, Blacksmith, KrazyTheFox, CCGHQ Admins

Targeting bug with copySpellontoStack

Postby 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?
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: Targeting bug with copySpellontoStack

Postby 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

Postby 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).
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: Targeting bug with copySpellontoStack

Postby 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.
User avatar
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

Postby Sloth » 02 Feb 2012, 18:41

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.
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: Targeting bug with copySpellontoStack

Postby 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.
User avatar
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


Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 11 guests

Main Menu

User Menu

Our Partners


Who is online

In total there are 11 users online :: 0 registered, 0 hidden and 11 guests (based on users active over the past 10 minutes)
Most users ever online was 9298 on 10 Oct 2025, 12:54

Users browsing this forum: No registered users and 11 guests

Login Form