From kde-commits Mon Jun 23 05:39:44 2003 From: Jason Katz-Brown Date: Mon, 23 Jun 2003 05:39:44 +0000 To: kde-commits Subject: KDE_3_1_BRANCH: kdegames/kolf X-MARC-Message: https://marc.info/?l=kde-commits&m=105634680205803 CVS commit by katz: fix the two most long-standing bugs in kolf.. cause i'm such a ditz and haven't gotten around to it before. If anybody wants to help me merge my stuff in the development branch to HEAD in two weeks after i return from Japan, I'd appreciate it. Cheers! M +5 -5 game.cpp 1.161.2.1 M +7 -1 slope.cpp 1.5.2.1 --- kdegames/kolf/game.cpp #1.161:1.161.2.1 @@ -2793,12 +2793,12 @@ void KolfGame::timeout() if ((*it).score(curHole) < holeInfo.maxStrokes() - 1 || !holeInfo.hasMaxStrokes()) { - shotDone(); loadStateList(); // increment curPlayer; he did take a shot, after all - (*curPlayer).addStrokeToHole(curHole); - emit scoreChanged((*curPlayer).id(), curHole, (*curPlayer).score(curHole)); + // 5-23, oops, no, he gets incremented in shotDone(). + //(*curPlayer).addStrokeToHole(curHole); + //emit scoreChanged((*curPlayer).id(), curHole, (*curPlayer).score(curHole)); } - else + shotDone(); --- kdegames/kolf/slope.cpp #1.5:1.5.2.1 @@ -329,4 +329,10 @@ bool Slope::collision(Ball *ball, long i ball->setVelocity(vx, vy); + + // check if the ball is at the center of a pit or mound + // or has otherwise stopped. + if (vx == 0 && vy ==0) + ball->setState(Stopped); + else ball->setState(Rolling);