Commit 7698787c authored by Waldo Bastian's avatar Waldo Bastian
Browse files

Fix for the often reported end game bug associated with

the gravity option. The problem is that the check for end of
game is being done before the tiles fall.
(backport)
Patch by Gary Park <garypark@pacbell.net>

svn path=/branches/KDE_2_2_BRANCH/kdegames/kshisen/; revision=117932
parent e61ed62c
......@@ -535,15 +535,9 @@ void Board::marked(int x, int y) {
mark_x = -1;
mark_y = -1;
int dummyx;
History dummyh[4];
// game is over?
if(!getHint_I(dummyx,dummyx,dummyx,dummyx,dummyh)) {
time_for_game = (int)difftime( time((time_t)0), starttime);
emit endOfGame();
}
// game is over?
// Must delay until after tiles fall to make this test
// See undrawArrow GP.
} else {
clearHistory();
emit markError();
......@@ -574,7 +568,7 @@ bool Board::canMakePath(int x1, int y1, int x2, int y2) {
}
bool Board::findPath(int x1, int y1, int x2, int y2) {
clearHistory();
clearHistory();
if(findSimplePath(x1, y1, x2, y2))
return true;
......@@ -714,6 +708,14 @@ void Board::undrawArrow() {
}
clearHistory();
int dummyx;
History dummyh[4];
// game is over?
if(!getHint_I(dummyx,dummyx,dummyx,dummyx,dummyh)) {
time_for_game = (int)difftime( time((time_t)0), starttime);
emit endOfGame();
}
}
QPoint Board::midCoord(int x, int y) {
......
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