[atlantik-cvs] CVS: kdegames/atlantik/libatlantikui board.cpp,1.96.6.9,1.96.6.10
[email protected] Mon, 14 Jul 2003 03:30:14 +0200 (CEST)
Newsgroups
gmane.comp.kde.devel.atlantik
Message-ID
<[email protected] >
Update of /home/kde/kdegames/atlantik/libatlantikui
In directory office:/tmp/cvs-serv5342/libatlantikui
Modified Files:
Tag: KDE_3_1_BRANCH
board.cpp
Log Message:
move playerSelf to core, fixes some token issues
Index: board.cpp
===================================================================
RCS file: /home/kde/kdegames/atlantik/libatlantikui/board.cpp,v
retrieving revision 1.96.6.9
retrieving revision 1.96.6.10
diff -u -d -r1.96.6.9 -r1.96.6.10
--- board.cpp 23 Jun 2003 02:54:54 -0000 1.96.6.9
+++ board.cpp 14 Jul 2003 01:30:11 -0000 1.96.6.10
@@ -89,6 +89,7 @@
m_estateViews.clear();
m_displayQueue.clear();
m_lastServerDisplay = 0;
+ m_movingToken = 0;
}
void AtlantikBoard::setViewProperties(bool indicateUnowned, bool highliteUnowned, bool darkenMortgaged, bool quartzEffects, bool animateTokens)
@@ -198,6 +199,12 @@
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;
+ }
Token *token = new Token(player, this, "token");
m_tokens.append(token);
@@ -211,11 +218,13 @@
void AtlantikBoard::playerChanged(Player *player)
{
+ Player *playerSelf = m_atlanticCore->playerSelf();
+
// Update token
Token *token = findToken(player);
if (token)
{
- if (player->isBankrupt())
+ if (player->isBankrupt() || (playerSelf && playerSelf->gameId() != player->gameId()) )
token->hide();
if (player->hasTurn())
token->raise();