[atlantik-cvs] CVS: kdegames/atlantik/libatlantic atlantic_core.cpp,1.24,1.25

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

Modified Files:
	atlantic_core.cpp 
Log Message:
do not just delete players, also remove porfolios, when resetting core

Index: atlantic_core.cpp
===================================================================
RCS file: /home/kde/kdegames/atlantik/libatlantic/atlantic_core.cpp,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- atlantic_core.cpp	14 Jul 2003 01:29:51 -0000	1.24
+++ atlantic_core.cpp	14 Jul 2003 07:15:48 -0000	1.25
@@ -48,22 +48,24 @@
 	for (QPtrListIterator<Trade> it(m_trades); (trade = *it) ; ++it)
 		removeTrade(trade);
 
-	if (deletePlayers)
-	{
-		m_players.setAutoDelete(true);
-		m_players.clear();
-		m_players.setAutoDelete(false);
-
-		m_playerSelf = 0;
-	}
-	else
+	Player *player = 0;
+	for (QPtrListIterator<Player> it(m_players); (player = *it) ; ++it)
 	{
-		Player *player = 0;
-		for (QPtrListIterator<Player> it(m_players); (player = *it) ; ++it)
+		if (deletePlayers)
+		{
+			emit removeGUI(player);
+			emit deletePlayer(player);
+		}
+		else
 		{
 			player->setLocation(0);
 			player->setDestination(0);
 		}
+	}
+	if (deletePlayers)
+	{
+		m_players.clear();
+		m_playerSelf = 0;
 	}
 }
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.