Summary: | KReversi: Changing the skill level late in a game doesn't count as cheating | ||
---|---|---|---|
Product: | [Applications] kreversi | Reporter: | Inge Wallin <inge> |
Component: | general | Assignee: | Inge Wallin <inge> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Compiled Sources | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
Inge Wallin
2004-09-24 22:54:27 UTC
CVS commit by ingwa: Fix bug 90195: KReversi: Changing the skill level late in a game doesn't count as cheating: Introduce a parameter lowestStrength that keeps track of the lowest strength used for the computer engine during the game. I will backport this to KDE_3_3_BRANCH. CCMAIL: 90195-done@bugs.kde.org M +9 -0 ChangeLog 1.39 M +4 -1 board.cpp 1.49 M +1 -0 board.h 1.21 --- kdegames/kreversi/ChangeLog #1.38:1.39 @@ -1,4 +1,13 @@ 2004-09-26 Inge Wallin <ingwa@c83-250-5-110.bredband.comhem.se> + Fix bug 90195: KReversi: Changing the skill level late in a game + doesn't count as cheating: + * board.h (Board::m_lowestStrength): new member + * board.cpp (Board::newGame): set m_lowestStrength + * board.cpp (Board::setStrength): update m_lowestStrength and + update highscore type. + +2004-09-26 Inge Wallin <inge@lysator.liu.se> + Fix Bug 90190: KReversi: Switch sides and then Undo gets the program out of sync. --- kdegames/kreversi/board.cpp #1.48:1.49 @@ -150,4 +150,5 @@ void Board::newGame() m_game->Reset(); m_competitiveGame = Prefs::competitiveGameChoice(); + m_lowestStrength = strength(); //kdDebug() << "Competitive: " << m_competitiveGame << endl; @@ -322,5 +323,7 @@ void Board::setStrength(uint st) st = QMAX(QMIN(st, 7), 1); m_engine->setStrength(st); - KExtHighscore::setGameType(st-1); + if (m_lowestStrength < st) + m_lowestStrength = st; + KExtHighscore::setGameType(m_lowestStrength-1); } --- kdegames/kreversi/board.h #1.20:1.21 @@ -146,4 +146,5 @@ private: State m_status; // Ready, Thinking, Hint + bool m_lowestStrength; // Lowest strength during the game. bool m_competitiveGame; // True if the game has been // competitive during all moves so far. Don't know if this is the same bug, but I started a game on Expert, played a couple moves, and changed it to Average. I won the game and it listed my high score in the Expert ranking rather than Average. KReversi v1.6 OS FreeBSD 6.0 Release for x86 gcc version 3.4.4 20050518 |