After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 779937 - Fischer clock on losing clock isn't set to 0
Fischer clock on losing clock isn't set to 0
Status: RESOLVED FIXED
Product: gnome-chess
Classification: Applications
Component: General
git master
Other Mac OS
: Normal normal
: ---
Assigned To: Sahil Sareen
gnome-chess-maint
Depends on:
Blocks:
 
 
Reported: 2017-03-12 12:41 UTC by Sahil Sareen
Modified: 2017-03-12 22:49 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
White wins but clock shows 1 second on the black timer (163.45 KB, image/png)
2017-03-12 12:41 UTC, Sahil Sareen
  Details
Preferences (60.28 KB, image/png)
2017-03-12 12:41 UTC, Sahil Sareen
  Details
10 second increment set in preferences (159.53 KB, image/png)
2017-03-12 12:42 UTC, Sahil Sareen
  Details
clock: Fix game ending too soon when using Fischer/Bronstein clocks (941 bytes, patch)
2017-03-12 15:54 UTC, Michael Catanzaro
none Details | Review

Description Sahil Sareen 2017-03-12 12:41:17 UTC
Created attachment 347747 [details]
White wins but clock shows 1 second on the black timer

Same for black and white.
Seems the Fischer clock is adding the increment even when the game is lost which shouldn't be the case.

Steps to reproduce:
- Select Fischer clock type from preferences
- Start the game and let one player loose because of time out
- Clock shows the "timer increment" amount of time remaining
Comment 1 Sahil Sareen 2017-03-12 12:41:47 UTC
Created attachment 347748 [details]
Preferences
Comment 2 Sahil Sareen 2017-03-12 12:42:53 UTC
Created attachment 347749 [details]
10 second increment set in preferences
Comment 3 Michael Catanzaro 2017-03-12 15:40:38 UTC
(In reply to Sahil Sareen from comment #0)
> Created attachment 347747 [details]
> White wins but clock shows 1 second on the black timer
> 
> Same for black and white.
> Seems the Fischer clock is adding the increment even when the game is lost
> which shouldn't be the case.

No, it's not adding the increment. It never makes it down to zero. Tt stops at the increment.
Comment 4 Michael Catanzaro 2017-03-12 15:48:56 UTC
I see in commit d00db10c103617fa3d864366eb335624b05ac559 you added ChessClock.white_extra_seconds and ChessClock.black_extra_seconds. Looks like these are not being properly accounted for in deciding when to end the game. For instance, if you have white make one move, the game ends when black has one increment of time remaining (1s or 10s in your examples). But if you have white make a move, black make a move, then white make another move, the game will end when black has two increments of time remaining (2s or 20s in your examples).
Comment 5 Michael Catanzaro 2017-03-12 15:54:39 UTC
Created attachment 347757 [details] [review]
clock: Fix game ending too soon when using Fischer/Bronstein clocks

This fixes it for me. Sahil, does it look sane?

Note that tomorrow is the last day to get this in before hard code freeze. Do you have time to push this and do a new release (3.23.92.5) before then, or do yaou want me to handle it? (And what about Sudoku?)
Comment 6 Michael Catanzaro 2017-03-12 15:54:58 UTC
Actually I'll just do them.
Comment 7 Sahil Sareen 2017-03-12 22:49:21 UTC
Thanks for fixing this Michael (and also for taking care of the releases)!
I'll be around more often now.