collections
Posted: Mon Jun 05, 2017 1:39 pm
having trouble track this problem down, any ideas
i read the following as the result will be 1 if needing the item and 0 if do not need the item, which is working ok when hovering over a collection item in inventory, and when hovering over a collection item in a completed collection but not when hovering over am imcomplete collection
i think this is the correct portion of code if not thats my issue , anywho, on hovering on both collection items in a completed and a not completed collection is evalutating ture and so returns false which would mean the collection item is not needed
here is a picture of the correct result
and here is the incorrect result, it should have the you have already collected this on it
i read the following as the result will be 1 if needing the item and 0 if do not need the item, which is working ok when hovering over a collection item in inventory, and when hovering over a collection item in a completed collection but not when hovering over am imcomplete collection
Code: Select all
packet->setSubstructDataByName("footer", "collection_needed", player->GetCollectionList()->NeedsItem(this) ? 1 : 0);Code: Select all
if (collection_item->found)Code: Select all
bool Collection::NeedsItem(Item *item) {
vector<struct CollectionItem *>::iterator itr;
struct CollectionItem *collection_item;
assert(item);
if (completed)
return false;
for (itr = collection_items.begin(); itr != collection_items.end(); itr++) {
collection_item = *itr;
if (collection_item->item->details.item_id == item->details.item_id) {
if (collection_item->found)
return false;
else
return true;
}
}
/* item is not required by this collection at all */
return false;
}