summaryrefslogtreecommitdiff
path: root/src/modlistsortproxy.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/modlistsortproxy.cpp')
-rw-r--r--src/modlistsortproxy.cpp23
1 files changed, 20 insertions, 3 deletions
diff --git a/src/modlistsortproxy.cpp b/src/modlistsortproxy.cpp
index 646401b9..3bb02c0f 100644
--- a/src/modlistsortproxy.cpp
+++ b/src/modlistsortproxy.cpp
@@ -305,18 +305,35 @@ bool ModListSortProxy::filterMatchesModOr(ModInfo::Ptr info, bool enabled) const
bool ModListSortProxy::criteriaMatchesMod(
ModInfo::Ptr info, bool enabled, const Criteria& c) const
{
+ bool b = false;
+
switch (c.type)
{
case TYPE_SPECIAL: // fall-through
case TYPE_CATEGORY:
- return categoryMatchesMod(info, enabled, c.id);
+ {
+ b = categoryMatchesMod(info, enabled, c.id);
+ break;
+ }
case TYPE_CONTENT:
- return contentMatchesMod(info, enabled, c.id);
+ {
+ b = contentMatchesMod(info, enabled, c.id);
+ break;
+ }
default:
- return false;
+ {
+ log::error("bad criteria type {}", c.type);
+ break;
+ }
}
+
+ if (c.inverse) {
+ b = !b;
+ }
+
+ return b;
}
bool ModListSortProxy::categoryMatchesMod(