Page 1 of 1

AF_Retrieve bug

PostPosted: 15 Nov 2010, 02:17
by Chris H.
We have five cards that are using AF_Retrieve. They all appear to have the same bug.

I cast an AF_Retrieve spell,
I pick a target card to retrieve,
I pay the costs,
The spell goes on the stack, but there is just a number and no description and I get this error exception:

Code: Select all
An error has occured. You can copy/paste this message or save it to a file.
Please report this, plus what you tried to do, to:
   http://www.slightlymagic.net/forum/viewforum.php?f=26
If you don't want to register an account, you can mail it directly to
   mtgerror@yahoo.com


forge.Target cannot be cast to forge.Card


Version:
Forge -- official beta: $Date: 2010-09-14 08:34:27 -0400 (Tue, 14 Sep 2010) $, SVN revision: $Revision: 2039 $

OS: Mac OS X Version: 10.6.4 Architecture: x86_64

Java Version: 1.6.0_22 Vendor: Apple Inc.

Detailed error trace:
java.lang.ClassCastException: forge.Target cannot be cast to forge.Card
   at forge.DefaultPlayerZone.remove(DefaultPlayerZone.java:105)
   at forge.AbilityFactory_Fetch.doRetrieve(AbilityFactory_Fetch.java:509)
   at forge.AbilityFactory_Fetch.access$2(AbilityFactory_Fetch.java:478)
   at forge.AbilityFactory_Fetch$4.resolve(AbilityFactory_Fetch.java:363)
   at forge.MagicStack.resolveStack(MagicStack.java:488)
   at forge.Phase.passPriority(Phase.java:562)
   at forge.ComputerAI_General.stackResponse(ComputerAI_General.java:278)
   at forge.ComputerAI_General.stack_not_empty(ComputerAI_General.java:243)
   at forge.InputControl.updateInput(InputControl.java:115)
   at forge.GuiInput.update(GuiInput.java:19)
   at java.util.Observable.notifyObservers(Observable.java:142)
   at java.util.Observable.notifyObservers(Observable.java:98)
   at forge.MyObservable.updateObservers(MyObservable.java:9)
   at forge.InputControl.resetInput(InputControl.java:32)
   at forge.Phase.passPriority(Phase.java:553)
   at forge.Input_PassPriority.selectButtonOK(Input_PassPriority.java:35)
   at forge.GuiInput.selectButtonOK(GuiInput.java:35)
   at forge.GuiDisplay3.okButtonActionPerformed(GuiDisplay3.java:1001)
   at forge.GuiDisplay3.access$3(GuiDisplay3.java:1000)
   at forge.GuiDisplay3$26.actionPerformed(GuiDisplay3.java:795)
   at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2028)
   at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2351)
   at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
   at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
   at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
   at java.awt.Component.processMouseEvent(Component.java:6352)
   at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
   at java.awt.Component.processEvent(Component.java:6117)
   at java.awt.Container.processEvent(Container.java:2085)
   at java.awt.Component.dispatchEventImpl(Component.java:4714)
   at java.awt.Container.dispatchEventImpl(Container.java:2143)
   at java.awt.Component.dispatchEvent(Component.java:4544)
   at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4621)
   at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4282)
   at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4212)
   at java.awt.Container.dispatchEventImpl(Container.java:2129)
   at java.awt.Window.dispatchEventImpl(Window.java:2478)
   at java.awt.Component.dispatchEvent(Component.java:4544)
   at java.awt.EventQueue.dispatchEvent(EventQueue.java:635)
   at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
   at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
   at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
   at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
   at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
   at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

Re: AF_Retrieve bug

PostPosted: 15 Nov 2010, 02:28
by friarsol
Looks like not all the variables were properly changed when multi-targeting was implemented. I changed the parts so it would use the Card not the Target class, hopefully that's all it needs.

Re: AF_Retrieve bug

PostPosted: 15 Nov 2010, 02:43
by Chris H.
friarsol wrote:Looks like not all the variables were properly changed when multi-targeting was implemented. I changed the parts so it would use the Card not the Target class, hopefully that's all it needs.
`
Thank you.

I will merge the bug fix into my local copy tomorrow and will re-run my test deck. I should be able to convert some (all?) of the spReturnTgt cards over to AF_Retrieve.