[atlantik-cvs] CVS: kdegames/atlantik/client atlantik.cpp, 1.157, 1.158
[email protected] Mon, 8 Dec 2003 18:10:23 +0100 (CET)
| Newsgroups | gmane.comp.kde.devel.atlantik |
|---|---|
| Message-ID | <[email protected]> |
Update of /home/kde/kdegames/atlantik/client
In directory office:/tmp/cvs-serv27872/client
Modified Files:
atlantik.cpp
Log Message:
bugfix: clear portfolioviews when playerSelf is not in game
Index: atlantik.cpp
===================================================================
RCS file: /home/kde/kdegames/atlantik/client/atlantik.cpp,v
retrieving revision 1.157
retrieving revision 1.158
diff -u -d -r1.157 -r1.158
--- atlantik.cpp 5 Aug 2003 03:03:34 -0000 1.157
+++ atlantik.cpp 8 Dec 2003 17:10:19 -0000 1.158
@@ -577,15 +577,18 @@
Player *playerSelf = m_atlanticCore->playerSelf();
if (player == playerSelf)
{
- // We changed ourselves, see if other players (that we know
- // about) have the same gameId..
+ // We changed ourselves..
PortfolioView *portfolioView = 0;
for (QPtrListIterator<PortfolioView> it(m_portfolioViews); *it; ++it)
if ((portfolioView = dynamic_cast<PortfolioView*>(*it)))
{
- Player *pTmp = portfolioView->player();
- if (pTmp->gameId() == playerSelf->gameId())
+ // Clear all portfolios if we're not in game
+ if ( player->gameId() == -1 )
+ portfolioView->clearPortfolio();
+
+ // Show players in our game, hide the rest
+ if ( portfolioView->player()->gameId() == playerSelf->gameId() )
portfolioView->show();
else
portfolioView->hide();