[atlantik-cvs] CVS: kdegames/atlantik/libatlantikui board.cpp,1.111,1.112

[email protected]
Newsgroups gmane.comp.kde.devel.atlantik
Message-ID <[email protected]>
Update of /home/kde/kdegames/atlantik/libatlantikui
In directory office:/tmp/cvs-serv5255/libatlantikui

Modified Files:
	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.111
retrieving revision 1.112
diff -u -d -r1.111 -r1.112
--- board.cpp	23 Jun 2003 03:05:25 -0000	1.111
+++ board.cpp	14 Jul 2003 01:29:51 -0000	1.112
@@ -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);
@@ -212,12 +219,15 @@
 void AtlantikBoard::playerChanged(Player *player)
 {
 	kdDebug() << "playerChanged: playerLoc " << (player->location() ? player->location()->name() : "none") << endl;
+
+	Player *playerSelf = m_atlanticCore->playerSelf();
+
 	// Update token
 	Token *token = findToken(player);
 	if (token)
 	{
 		kdDebug() << "playerChanged: tokenLoc " << (token->location() ? token->location()->name() : "none") << endl;
-		if (player->isBankrupt())
+		if (player->isBankrupt() || (playerSelf && playerSelf->gameId() != player->gameId()) )
 			token->hide();
 		if (player->hasTurn())
 			token->raise();
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.