[atlantik-cvs] CVS: kdegames/atlantik/libatlantikui board.cpp,1.112,1.113
[email protected] Mon, 14 Jul 2003 04:52:46 +0200 (CEST)
Newsgroups
gmane.comp.kde.devel.atlantik
Message-ID
<[email protected] >
Update of /home/kde/kdegames/atlantik/libatlantikui
In directory office:/tmp/cvs-serv6235/libatlantikui
Modified Files:
board.cpp
Log Message:
more token related fixes
Index: board.cpp
===================================================================
RCS file: /home/kde/kdegames/atlantik/libatlantikui/board.cpp,v
retrieving revision 1.112
retrieving revision 1.113
diff -u -d -r1.112 -r1.113
--- board.cpp 14 Jul 2003 01:29:51 -0000 1.112
+++ board.cpp 14 Jul 2003 02:52:44 -0000 1.113
@@ -85,6 +85,8 @@
void AtlantikBoard::reset()
{
+ kdDebug() << "AtlantikBoard::reset" << endl;
+
m_tokens.clear();
m_estateViews.clear();
m_displayQueue.clear();
@@ -199,12 +201,15 @@
kdDebug() << "addToken - estateView null" << endl;
return;
}
+
Player *playerSelf = m_atlanticCore->playerSelf();
if (playerSelf && playerSelf->gameId() != player->gameId())
{
kdDebug() << "addToken - not in same game" << endl;
return;
}
+ else
+ kdDebug() << "addToken - no playerSelf" << endl;
Token *token = new Token(player, this, "token");
m_tokens.append(token);
@@ -272,6 +277,8 @@
void AtlantikBoard::removeToken(Player *player)
{
Token *token = findToken(player);
+ if (!token)
+ return;
if (token == m_movingToken)
{
@@ -393,7 +400,7 @@
else
yDest = yCurrent;
- kdDebug() << "TOKEN: at " << xCurrent << "," << yCurrent << " and going to " << xDest << "," << yDest << endl;
+// kdDebug() << "TOKEN: at " << xCurrent << "," << yCurrent << " and going to " << xDest << "," << yDest << endl;
if (xCurrent != xDest || yCurrent != yDest)
{