fix item inventoryFilters handling
This commit is contained in:
parent
1210a75fb7
commit
3205f3b283
@ -12,5 +12,7 @@
|
||||
"maxWireTrans" : 0.4
|
||||
},
|
||||
|
||||
"inventoryFilters" : { "default" : {} },
|
||||
|
||||
"swapDance" : null // Set this to a valid dance to trigger on character swap.
|
||||
}
|
@ -947,14 +947,14 @@ bool PlayerInventory::checkInventoryFilter(ItemPtr const& items, String const& f
|
||||
|
||||
auto itemFilters = items->instanceValue("inventoryFilters");
|
||||
if (itemFilters.isType(Json::Type::Object)) {
|
||||
filterConfig = itemFilters.get(filterName);
|
||||
filterConfig = itemFilters.opt(filterName).value();
|
||||
if (!filterConfig.isType(Json::Type::Object))
|
||||
filterConfig = itemFilters.get("default");
|
||||
filterConfig = itemFilters.opt("default").value();
|
||||
}
|
||||
|
||||
if (!filterConfig.isType(Json::Type::Object)) {
|
||||
auto config = Root::singleton().assets()->json("/player.config:inventoryFilters");
|
||||
filterConfig = config.get(filterName);
|
||||
filterConfig = config.opt(filterName).value();
|
||||
if (!filterConfig.isType(Json::Type::Object))
|
||||
filterConfig = config.get("default");
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user