------------------------------------------------------------------------------- -- Check the class filter flags ------------------------------------------------------------------------------- local class_filters = filter_db.classes toggled_off, toggled_on = 0, 0 for class, flag in pairs(CLASS_FILTERS) do local bitfield = recipe.flags.class1 if bitfield and bit.band(bitfield, flag) == flag then if class_filters[class] then toggled_on = toggled_on + 1 else toggled_off = toggled_off + 1 end end end if toggled_off > 0 and toggled_on == 0 then return false end ------------------------------------------------------------------------------------------------ -- Stage 2 -- loop through nonexclusive (soft filters) flags until one is true -- If one of these is true (ie: we want to see trainers and there is a trainer flag) we display the recipe ------------------------------------------------------------------------------------------------ for filter, data in pairs(SOFT_FILTERS) do local bitfield = recipe.flags[private.flag_members[data.index]] if bitfield and bit.band(bitfield, data.flag) == data.flag and data.sv_root[filter] then return true end end