Bug 357144

Summary: In Chess against Tux, the "redo" button does not work well
Product: [Applications] gcompris Reporter: Stefan Toncu <stefan.toncu29>
Component: generalAssignee: Bruno Coudoin <bruno.coudoin>
Status: RESOLVED FIXED    
Severity: normal CC: stefan.toncu29
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
URL: https://youtu.be/GCgbet-gfSA
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: Fix for the 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.