Bug 357144 - In Chess against Tux, the "redo" button does not work well
Summary: In Chess against Tux, the "redo" button does not work well
Status: RESOLVED FIXED
Alias: None
Product: gcompris
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Bruno Coudoin
URL: https://youtu.be/GCgbet-gfSA
Keywords:
Depends on:
Blocks:
 
Reported: 2015-12-25 11:18 UTC by Stefan Toncu
Modified: 2016-01-17 01:16 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Fix for the Bug (1.60 KB, patch)
2016-01-10 20:39 UTC, Stefan Toncu
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Toncu 2015-12-25 11:18:41 UTC
When i play against Tux, after i redo some moves very quickly, the game rules change:
- a message is shown: "invalid, your king may be in check" but it is not true
- white has done 2 moves instead of one
- i do not play with white -> i am switched to blacks
- the pieces no longer moves as they should (in the link on Youtube: 00:54 - [1];  1:16 - [2])
   [1]  https://youtu.be/GCgbet-gfSA?t=54s
   [2]  https://youtu.be/GCgbet-gfSA?t=1m16s
- after black is checked (1:28 - [3]), i move the king, white does not make any move and i can move again
   [3]  https://youtu.be/GCgbet-gfSA?t=1m28s

Reproducible: Always

Steps to Reproduce:
1. Start Chess against Tux
2. Make 4-5 moves
3. Undo all moves
4. Redo very quickly all the moves

Actual Results:  
The game does not work properly anymore.

Expected Results:  
Redo the moves without any problems to their original position.

I got this bug on my Android and managed to replicate it on Ubuntu 15.10.
I attached a link to a Youtube video where i replicate this bug.
Comment 1 Stefan Toncu 2016-01-10 20:39:37 UTC
Created attachment 96573 [details]
Fix for the Bug

I fixed the Redo Button bug by adding a variable "acceptClick" that makes the redo possible only after the animation is finished. This way i am preventing the bug from happening.
Comment 2 Bruno Coudoin 2016-01-17 01:16:07 UTC
Fixed in master. I made a little change to make the button visibility depend on the variable you created.