Example #1
0
/**
 * @brief Removes an activator from the list of recognized edicts
 * @param self The trigger self pointer
 * @param activator The activating edict (might be nullptr)
 * @return @c true if removal was successful or not needed, @c false if the activator wasn't found in the list
 */
bool G_TriggerRemoveFromList (Edict* self, Edict* activator)
{
    if (activator == nullptr)
        return true;

    linkedList_t** list = &self->touchedList;
    while (*list) {
        linkedList_t* entry = *list;
        if (entry->data == activator) {
            *list = entry->next;
            G_MemFree(entry);
            return true;
        }
        list = &entry->next;
    }

    return false;
}
Example #2
0
static void G_FreeInventory (void* data)
{
	G_MemFree(data);
}