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;
}