diff --git a/assets/opensb/player.config.patch b/assets/opensb/player.config.patch index 5960507..bd5cbc8 100644 --- a/assets/opensb/player.config.patch +++ b/assets/opensb/player.config.patch @@ -12,5 +12,7 @@ "maxWireTrans" : 0.4 }, + "inventoryFilters" : { "default" : {} }, + "swapDance" : null // Set this to a valid dance to trigger on character swap. } \ No newline at end of file diff --git a/source/game/StarPlayerInventory.cpp b/source/game/StarPlayerInventory.cpp index 0fed167..4b9cff2 100644 --- a/source/game/StarPlayerInventory.cpp +++ b/source/game/StarPlayerInventory.cpp @@ -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"); }