[atlantik-cvs] CVS: kdegames/atlantik/libatlantikclient atlantik_network.cpp,1.85,1.86 atlantik_network.h,1.44,1.45

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

Modified Files:
	atlantik_network.cpp atlantik_network.h 
Log Message:
removed buggy trademap in network code for decent ptrlist in core

Index: atlantik_network.cpp
===================================================================
RCS file: /home/kde/kdegames/atlantik/libatlantikclient/atlantik_network.cpp,v
retrieving revision 1.85
retrieving revision 1.86
diff -u -d -r1.85 -r1.86
--- atlantik_network.cpp	9 Jun 2003 18:25:45 -0000	1.85
+++ atlantik_network.cpp	17 Jun 2003 18:21:28 -0000	1.86
@@ -640,13 +640,12 @@
 				{
 					int tradeId = a.value().toInt();
 
-					Trade *trade;
+					Trade *trade = m_atlanticCore->findTrade(tradeId);
 					bool b_newTrade = false;
-					if (!(trade = m_trades[tradeId]))
+					if (!trade)
 					{
 						// Create trade object
 						trade = m_atlanticCore->newTrade(tradeId);
-						m_trades[tradeId] = trade;
 
 						QObject::connect(trade, SIGNAL(updateEstate(Trade *, Estate *, Player *)), this, SLOT(tradeUpdateEstate(Trade *, Estate *, Player *)));
 						QObject::connect(trade, SIGNAL(updateMoney(Trade *, unsigned int, Player *, Player *)), this, SLOT(tradeUpdateMoney(Trade *, unsigned int, Player *, Player *)));
@@ -684,7 +683,6 @@
 					else if (type=="completed" && trade)
 					{
 						m_atlanticCore->removeTrade(trade);
-						m_trades[tradeId] = 0;
 						trade = 0;
 					}
 					else if (type=="rejected")
@@ -695,7 +693,6 @@
 						if (player && player->isSelf())
 						{
 							m_atlanticCore->removeTrade(trade);
-							m_trades[tradeId] = 0;
 							trade = 0;
 						}
 					}

Index: atlantik_network.h
===================================================================
RCS file: /home/kde/kdegames/atlantik/libatlantikclient/atlantik_network.h,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -d -r1.44 -r1.45
--- atlantik_network.h	8 Feb 2003 15:36:03 -0000	1.44
+++ atlantik_network.h	17 Jun 2003 18:21:28 -0000	1.45
@@ -171,7 +171,6 @@
 	int m_playerId;
 
 	QMap<Player *, int> m_playerLocationMap;
-	QMap<int, Trade *> m_trades;
 	QMap<int, Auction *> m_auctions;
 };
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.