[wpdev-commits] wolfpack/network uosocket.cpp,1.436,1.437
Brought to you by:
rip,
thiagocorrea
From: Sebastian H. <dar...@us...> - 2004-11-02 20:45:58
|
Update of /cvsroot/wpdev/wolfpack/network In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28950/network Modified Files: uosocket.cpp Log Message: Container content changes Index: uosocket.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/network/uosocket.cpp,v retrieving revision 1.436 retrieving revision 1.437 diff -C2 -d -r1.436 -r1.437 *** uosocket.cpp 30 Oct 2004 16:03:21 -0000 1.436 --- uosocket.cpp 2 Nov 2004 20:45:46 -0000 1.437 *************** *** 2031,2042 **** Q_INT32 count = 0; - cItem::ContainerContent container = pCont->content(); - cItem::ContainerContent::const_iterator it( container.begin() ); - cItem::ContainerContent::const_iterator end( container.end() ); QPtrList<cItem> tooltipItems; ! tooltipItems.setAutoDelete( false ); ! ! for ( ; it != end; ++it ) ! { P_ITEM pItem = *it; --- 2031,2037 ---- Q_INT32 count = 0; QPtrList<cItem> tooltipItems; ! ! for (ContainerIterator it(pCont); !it.atEnd(); ++it) { P_ITEM pItem = *it; *************** *** 2634,2644 **** QPtrList<cItem> items; - cItem::ContainerContent container = pItem->content(); - cItem::ContainerContent::const_iterator it( container.begin() ); - cItem::ContainerContent::const_iterator end( container.end() ); - SortedSerialList sortedList; ! for ( ; it != end; ++it ) ! { sortedList.append( *it ); } --- 2629,2634 ---- QPtrList<cItem> items; SortedSerialList sortedList; ! for ( ContainerIterator it(pItem); !it.atEnd(); ++it) { sortedList.append( *it ); } *************** *** 2704,2710 **** pStock->setTag("last_restock_time", Server::instance()->time()); // Set the last restock time ! cItem::ContainerContent::iterator it; ! cItem::ContainerContent pStockContent = pStock->content(); // We need a copy since we are modifying the array ! for (it = pStockContent.begin(); it != pStockContent.end(); ++it) { P_ITEM pItem = *it; --- 2694,2698 ---- pStock->setTag("last_restock_time", Server::instance()->time()); // Set the last restock time ! for ( ContainerIterator it(pStock); !it.atEnd(); ++it) { P_ITEM pItem = *it; *************** *** 2732,2740 **** // Build the list of items to be sent. SortedSerialList itemList; - cItem::ContainerContent::iterator it; - cItem::ContainerContent pStockContent = pStock->content(); // We need a copy since we are modifying the array // Process all items for sale first ! for (it = pStockContent.begin(); it != pStockContent.end(); ++it) { if (itemList.count() >= 250) { break; // Only 250 items fit into the buy packet --- 2720,2726 ---- // Build the list of items to be sent. SortedSerialList itemList; // Process all items for sale first ! for ( ContainerIterator it(pStock); !it.atEnd(); ++it) { if (itemList.count() >= 250) { break; // Only 250 items fit into the buy packet *************** *** 2749,2754 **** // Now process all items that have been bought by the vendor ! cItem::ContainerContent pBoughtContent = pBought->content(); // We need a copy since we are modifying the array ! for (it = pBoughtContent.begin(); it != pBoughtContent.end(); ++it) { // Check all bought items if they decayed (one hour) int buy_time = (*it)->getTag("buy_time").toInt(); --- 2735,2739 ---- // Now process all items that have been bought by the vendor ! for (ContainerCopyIterator it(pBought); !it.atEnd(); ++it) { // Check all bought items if they decayed (one hour) int buy_time = (*it)->getTag("buy_time").toInt(); *************** *** 2838,2859 **** static void walkSellItems(P_ITEM pCont, P_ITEM pPurchase, QPtrList<cItem> &items) { - cItem::ContainerContent container = pPurchase->content(); - cItem::ContainerContent::const_iterator it( container.begin() ); - cItem::ContainerContent::const_iterator end( container.end() ); - - cItem::ContainerContent packcont = pCont->content(); - cItem::ContainerContent::const_iterator pit; - // For every pack item search for an equivalent sellitem ! pit = packcont.begin(); ! while ( pit != packcont.end() ) { P_ITEM pItem = *pit; // Containers with content are walked and _not_ sold ! if (pItem->type() == 1 && pItem->content().size() > 0) { walkSellItems(pItem, pPurchase, items); } else { // Search all sellable items ! for (it = container.begin(); it != container.end(); ++it) { P_ITEM mItem = *it; if ( pItem->baseid() == mItem->baseid() && pItem->scriptList() == mItem->scriptList() ) { --- 2823,2836 ---- static void walkSellItems(P_ITEM pCont, P_ITEM pPurchase, QPtrList<cItem> &items) { // For every pack item search for an equivalent sellitem ! for ( ContainerIterator pit(pCont); !pit.atEnd(); ++pit) { P_ITEM pItem = *pit; // Containers with content are walked and _not_ sold ! if (pItem->type() == 1 && pItem->content().count() > 0) { walkSellItems(pItem, pPurchase, items); } else { // Search all sellable items ! for ( ContainerIterator it(pPurchase); !it.atEnd(); ++it) { P_ITEM mItem = *it; if ( pItem->baseid() == mItem->baseid() && pItem->scriptList() == mItem->scriptList() ) { *************** *** 2863,2868 **** } } - - ++pit; } } --- 2840,2843 ---- |