It is currently 07 Jul 2021, 14:47
   
Text Size

The blinking bug

Post MTG Forge Related Programming Questions Here

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

The blinking bug

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

Re: The blinking bug

Postby 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?
friarsol
Global Moderator
 
Posts: 7575
Joined: 15 May 2010, 04:20
Has thanked: 242 times
Been thanked: 956 times

Re: The blinking bug

Postby Sloth » 28 Apr 2013, 11:52

Ok, fix is in place: setupPlayZone will now update cards that have changed their timestamp.
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times


Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 14 guests


Who is online

In total there are 14 users online :: 0 registered, 0 hidden and 14 guests (based on users active over the past 10 minutes)
Most users ever online was 1922 on 07 Jun 2021, 06:01

Users browsing this forum: No registered users and 14 guests

Login Form