[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-bugs-dist
Subject: [Bug 131587] "cannot win this game" message just after start of mod3
From: Inge Wallin <inge () lysator ! liu ! se>
Date: 2006-09-07 21:04:13
Message-ID: 20060907210413.27589.qmail () ktown ! kde ! org
[Download RAW message or body]
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
http://bugs.kde.org/show_bug.cgi?id=131587
------- Additional Comments From inge lysator liu se 2006-09-07 23:04 -------
SVN commit 581889 by ingwa:
Fix bug 131587: "cannot win this game" message just after start of mod3 game
Forward port of fix for 3.5 branch.
CCBUGS: 131587
M +6 -0 CHANGES
M +9 -3 mod3.cpp
--- trunk/KDE/kdegames/kpat/CHANGES #581888:581889
@ -1,5 +1,11 @
2005-06-25 Inge Wallin <inge lysator liu se>
+ Fix bug 131587: "cannot win this game" message just after
+ start of mod3 game
+ - Check for ace at the store in addition to empty
+
+2005-06-25 Inge Wallin <inge lysator liu se>
+
Code cleaning
- Rename Card::Value --> Card::Rank
- Rename Card::Suites --> Card::Suit
--- trunk/KDE/kdegames/kpat/mod3.cpp #581888:581889
@ -73,6 +73,7 @
bool Mod3::checkAdd( int checkIndex, const Pile *c1, const CardList& cl) const
{
// kDebug(11111) << "checkAdd " << checkIndex << " " << c1->top()->name() << " " \
<< c1->index() << " " << c1->index() / 10 << endl; +
if (checkIndex == 0) {
Card *c2 = cl.first();
@ -95,11 +96,15 @
kDebug(11111) << "+1\n";
return true;
+
} else if (checkIndex == 1) {
return c1->isEmpty();
+
} else if (checkIndex == 2) {
return cl.first()->rank() == Card::Ace;
- } else return false;
+
+ } else
+ return false;
}
@ -187,9 +192,10 @
bool nextTest=false;
- // If there is an empty stack below, the game is not lost.
+ // If there is an empty stack or an ace below, the game is not lost.
for (col=0; col < 8; col++){
- if (stack[3][col]->isEmpty())
+ if (stack[3][col]->isEmpty()
+ || stack[3][col]->at(0)->rank() == Card::Ace)
return false;
}
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic