The blinking bug
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Agetian, friarsol, Blacksmith, KrazyTheFox, CCGHQ Admins
3 posts
• Page 1 of 1
The blinking bug
by Sloth » 27 Apr 2013, 14:09
I spend some time tracking down the bug mentioned here: viewtopic.php?f=26&t=10182&sid=ed01a6bd3730cbed9aa495982b197f32#p116433
To reproduce the bug play Cloudshift on a creature you control, let it resolve, then cast another spell targeting this creature (for exapmle Vindicate). The second spell will fizzle!
What's happening:
1. The Cloudshifted creature is coming back with a new timestamp, but the card shown on the board is still linked to the old card object with the old timestamp.
2. When you target this card by clicking on it the object linked by target is the old card object.
3. When the spell resolves the hasFizzled function calls getCardState to get the new version of the card and compares timestamps, which fails.
So we need a way to tell the cardpanel to update its link to the new card object, when a blink effect resolves.
Any ideas how to do this?
To reproduce the bug play Cloudshift on a creature you control, let it resolve, then cast another spell targeting this creature (for exapmle Vindicate). The second spell will fizzle!
What's happening:
1. The Cloudshifted creature is coming back with a new timestamp, but the card shown on the board is still linked to the old card object with the old timestamp.
2. When you target this card by clicking on it the object linked by target is the old card object.
3. When the spell resolves the hasFizzled function calls getCardState to get the new version of the card and compares timestamps, which fails.
So we need a way to tell the cardpanel to update its link to the new card object, when a blink effect resolves.
Any ideas how to do this?
-

Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: The blinking bug
by friarsol » 27 Apr 2013, 16:54
It looks like there's a call in GameAction.moveTo() for updateLabelObservers() but the function is empty. Did this function used to sync the UI elements?
Edit: Nevermind, it's not empty, but it only updates the Hand observers?
Edit: Nevermind, it's not empty, but it only updates the Hand observers?
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: The blinking bug
by Sloth » 28 Apr 2013, 11:52
Ok, fix is in place: setupPlayZone will now update cards that have changed their timestamp.
-

Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
3 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 21 guests