summaryrefslogtreecommitdiffstats
path: root/demos
diff options
context:
space:
mode:
authorAlan Alpert <alan.alpert@nokia.com>2010-10-14 00:01:14 (GMT)
committerAlan Alpert <alan.alpert@nokia.com>2010-10-14 00:01:14 (GMT)
commitd2a8898e4d42fcf2c4cb51e9117690ae1616e350 (patch)
treeedbf3b5323482de4c151458d787674897b8e093d /demos
parent28ef9731df2b3cd865af89cc474c5fa20c24e492 (diff)
downloadQt-d2a8898e4d42fcf2c4cb51e9117690ae1616e350.zip
Qt-d2a8898e4d42fcf2c4cb51e9117690ae1616e350.tar.gz
Qt-d2a8898e4d42fcf2c4cb51e9117690ae1616e350.tar.bz2
Make minehunt less cheerful
An instance of failure being improperly shown as victory was rectified. Task-number: QT-3956
Diffstat (limited to 'demos')
-rw-r--r--demos/declarative/minehunt/minehunt.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/demos/declarative/minehunt/minehunt.cpp b/demos/declarative/minehunt/minehunt.cpp
index 9c82f30..709d945 100644
--- a/demos/declarative/minehunt/minehunt.cpp
+++ b/demos/declarative/minehunt/minehunt.cpp
@@ -195,6 +195,7 @@ bool MinehuntGame::flip(int row, int col)
won = false;
hasWonChanged();
setPlaying(false);
+ return true;
}
remaining--;
@@ -202,6 +203,7 @@ bool MinehuntGame::flip(int row, int col)
won = true;
hasWonChanged();
setPlaying(false);
+ return true;
}
return true;
}
@@ -209,7 +211,7 @@ bool MinehuntGame::flip(int row, int col)
bool MinehuntGame::flag(int row, int col)
{
TileData *t = tile(row, col);
- if(!t)
+ if(!t || !playing)
return false;
t->setHasFlag(!t->hasFlag());