[atlantik-cvs] CVS: kdegames/atlantik/libatlantikclient atlantik_network.cpp,1.65.4.10,1.65.4.11 atlantik_network.h,1.34.4.5,1.34.4.6

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

Modified Files:
      Tag: KDE_3_1_BRANCH
	atlantik_network.cpp atlantik_network.h 
Log Message:
backport: 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.65.4.10
retrieving revision 1.65.4.11
diff -u -d -r1.65.4.10 -r1.65.4.11
--- atlantik_network.cpp	31 Jan 2003 06:24:39 -0000	1.65.4.10
+++ atlantik_network.cpp	17 Jun 2003 18:21:34 -0000	1.65.4.11
@@ -614,13 +614,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 *)));
@@ -655,7 +654,6 @@
 					else if (type=="completed" && trade)
 					{
 						m_atlanticCore->removeTrade(trade);
-						m_trades[tradeId] = 0;
 						trade = 0;
 					}
 					else if (type=="rejected")
@@ -666,7 +664,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.34.4.5
retrieving revision 1.34.4.6
diff -u -d -r1.34.4.5 -r1.34.4.6
--- atlantik_network.h	21 Jan 2003 02:36:42 -0000	1.34.4.5
+++ atlantik_network.h	17 Jun 2003 18:21:34 -0000	1.34.4.6
@@ -165,7 +165,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.