Commit 22d04eff authored by Albert Astals Cid's avatar Albert Astals Cid
Browse files

Fix stroke count being increased more than once when hitting the ball

In some cases the ball thought was stopped then not, then stopped, then not, and you get like 100 strokes added instead of one

BUGS: 414791

Reviewers: #kde_applications

Differential Revision:
parent b6dbfcaf
......@@ -1378,6 +1378,14 @@ void KolfGame::shotDone()
Ball *ball = (*curPlayer).ball();
if(ball->curState() == Rolling) {
// This is a bit of a hack, since we have different timers for detecting shotDone and for doing animation, it can happen that at some point we think the shot
// was done, do a singleshot 0 call, but then we continue the animation and we realize it's not really done, so here make sure we're realy done
// before adding a stroke to the player
inPlay = true;
if (!dontAddStroke && (*curPlayer).numHoles())
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment