From: <ma...@us...> - 2013-04-05 16:41:27
|
Revision: 8671 http://planeshift.svn.sourceforge.net/planeshift/?rev=8671&view=rev Author: magodra Date: 2013-04-05 16:41:20 +0000 (Fri, 05 Apr 2013) Log Message: ----------- - Fixed (PS#5967) to use the categories given by player as patterns in searching for the item. Modified Paths: -------------- trunk/src/server/bulkobjects/pscharacter.cpp Modified: trunk/src/server/bulkobjects/pscharacter.cpp =================================================================== --- trunk/src/server/bulkobjects/pscharacter.cpp 2013-04-04 20:35:24 UTC (rev 8670) +++ trunk/src/server/bulkobjects/pscharacter.cpp 2013-04-05 16:41:20 UTC (rev 8671) @@ -1675,7 +1675,7 @@ { csArray<psItem*> items; - for(size_t x = 0; x < lootPending.GetSize(); x++) + for(size_t x = lootPending.GetSize()-1; x >= 0; x--) { if(!lootPending[x]) { @@ -1684,12 +1684,23 @@ continue; } - if(categories.IsEmpty() || - categories.Find(lootPending[x]->GetCategory()->name.Downcase()) != csArrayItemNotFound) + if(categories.IsEmpty()) { items.Push(lootPending[x]); lootPending.DeleteIndex(x); } + else + { + for (size_t i = 0; i < categories.GetSize(); i++) + { + if (lootPending[x]->GetCategory()->name.Downcase().Find(categories[i]) != csArrayItemNotFound) + { + items.Push(lootPending[x]); + lootPending.DeleteIndex(x); + break; // inner loop. Item in pos x was removed + } + } + } } return items; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |