X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcategory.cpp;h=5e454bb9dc7af7dcef5843efa9b4a3b96761404c;hb=694d2890065b1555a01a81994cb80f106ca577ee;hp=bb2484dca021cbe11e52953ccf3f1c10ef65dbe7;hpb=affc72bbd6ef9bcf2c5f94553a53582d42d40cc2;p=poefilter.git diff --git a/source/category.cpp b/source/category.cpp index bb2484d..5e454bb 100644 --- a/source/category.cpp +++ b/source/category.cpp @@ -47,7 +47,11 @@ void Category::create_statements(list &st) const st.push_back(FilterStatement()); if(condition) - condition->add_lines(st); + { + Condition *flat = condition->flatten(); + flat->add_lines(st); + delete flat; + } } @@ -59,6 +63,7 @@ Category::Loader::Loader(Category &c, const PoeFilter &p, CompoundCondition *n): { add("and", &Loader::and_); add("base_type", &Loader::condition); + add("category", &Loader::category); add("class", &Loader::condition); add_range("drop_level"); add_range("height"); @@ -106,6 +111,12 @@ void Category::Loader::and_() add_condition(cond.release()); } +void Category::Loader::category(const string &name) +{ + const Category &categ = poe.get_category(name); + add_condition(categ.condition->clone()); +} + template void Category::Loader::condition(typename T::Type value) {