23 static std::vector<std::pair<object *, tag_t>>
friends;
39 LOG(
llevError,
"add_friendly_object: Trying to add object already on list (%s)\n",
op->name);
54 auto find = std::find_if(
friends.begin(),
friends.end(), [&] (
auto item) { return item.first == op; });
56 if ((*find).second !=
op->count) {
57 LOG(
llevError,
"remove_friendly_object, tags do no match, %s, %u != %u\n",
58 op->name ?
op->name :
"none",
op->count, (*find).second);
72 LOG(llevError,
"%s (%u)\n", item.first->name, item.second);
87 || ((*item).first->count != (*item).second)) {
120 if (owner == NULL || object_get_owner(item.first) == owner) {
121 objectlink *add = get_objectlink();
122 add->id = item.second;
123 add->ob = item.first;
150 auto pos = std::find_if(
friends.begin(),
friends.end(), [&] (
const auto item) { return item.first == current; });
155 return pos ==
friends.end() ? nullptr : (*pos).first;