Bug 199844 - Timer keeps running even if game is won
Summary: Timer keeps running even if game is won
Status: RESOLVED FIXED
Alias: None
Product: kmahjongg
Classification: Applications
Component: general (show other bugs)
Version: 0.8
Platform: openSUSE Unspecified
: NOR normal
Target Milestone: ---
Assignee: Mauricio Piacentini
URL:
Keywords:
: 233776 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-07-12 11:03 UTC by Ruchir Brahmbhatt
Modified: 2016-01-04 00:14 UTC (History)
7 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Leave timer stopped at the end of a game (760 bytes, patch)
2014-12-24 01:06 UTC, Jan-Peter Nilsson
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ruchir Brahmbhatt 2009-07-12 11:03:22 UTC
Version:           0.8 (using KDE 4.2.96)
Installed from:    SuSE RPMs

When we play kmahjon and win, the timer in status bar still keeps running. It should start only if we start a new game.
Comment 1 Frederik Schwarzer 2010-04-19 16:03:53 UTC
Hase anthing beed done here? (Sorry, I suck at mahjongg so I have a hard time reproducing ;))
Comment 2 Frederik Schwarzer 2010-04-19 16:26:27 UTC
Well, the time indeed starts for the demo that is played after winning a game. If you select to start a new game, the clock is restarted though.
Comment 3 Frederik Schwarzer 2010-04-19 22:41:15 UTC
*** Bug 233776 has been marked as a duplicate of this bug. ***
Comment 4 Frederik Schwarzer 2010-04-19 22:43:22 UTC
So the confusion comes from the fact that the time continues after a game has been ended.
It would be much clearer if the time stopped when finishing a game and only was reset and restarted when starting a new game.
Comment 5 Toralf Förster 2010-04-20 20:04:55 UTC
Furthermore what's about holding the time as long as the window is minimized ?
Comment 6 Jens 2010-05-31 14:16:07 UTC
Actually, the counter is reset twice. Chain of events:

user clicks "new game"
initial board gets displayed
timer starts at 0
game is played, here with success
timer stops
popup "you have won"
timer restarts at 0 <-- here is the bug
all moves are shown again, once in reverse, then as played
empty board, but "undo" is still useable <-- here is a followup problem
repeat from start

The followup problem enables the user to go back to the game play, in a state
where the game is nearly finished and the timer has a very low value.
This makes the highscore table worthless.

Better solution:
Remove the restart marked with "here is the bug"
On "undo" with a stopped timer, just start it a the present value, so any repeated uses of an already finished game can only result in a worse result. Or even better: don't allow "undo" after a success, so that only normal games make it to the highscore list.

This may change the severity to "major", because any value the data in the highscore list may have is lost.
Comment 7 Toralf Förster 2010-05-31 15:15:33 UTC
(In reply to comment #6)
 
> The followup problem enables the user to go back to the game play, in a state
> where the game is nearly finished and the timer has a very low value.
What a cool trick :-) BTW I'm wondering about bug #238329 too.
Comment 8 Dan 2012-07-22 18:41:33 UTC
There's another bug here, caused by this.  The problem is that the timer resets when you finish the game.  This should not happen, and causes two problems.
1) you can't see what your time was, if you didn't place in the high score list, unless you happened to look at the time right before you removed the last pair of tiles.  This is merely annoying.
2) BUG: if you wait for the animation to finish, you can click "undo", and then remove the last pair of tiles again, and your time will be about 15 seconds, and place you right at the top of the high score list, which is just plain wrong.
Comment 9 Christian Krippendorf 2012-07-22 19:38:20 UTC
@ 2)
The Bug will be solved in future release and is already solved in branches/work/krippendorf. When doing internal ports i rewrote a lot.
So i am on work and will close this, when its done.

Thx
Comment 10 Jan-Peter Nilsson 2014-12-24 01:06:38 UTC
Created attachment 90113 [details]
Leave timer stopped at the end of a game

The timer is already restarted for new games so only load need a small update to handle that the timer may not already being running.
Comment 11 Frederik Schwarzer 2016-01-04 00:14:15 UTC
As far as I can tell, this problem is fixed in the master branch now and should be shipped with the new major version of kde applications.

Please test the master version and reopen if you think the issue is not handled properly.