From aca22663e6c5b53953176713ce71ce9251468c2b Mon Sep 17 00:00:00 2001 From: FM1337 <5448220+FM1337@users.noreply.github.com> Date: Wed, 3 Apr 2024 21:36:59 -0300 Subject: [PATCH] FIx bag editor item list --- 3ds/source/gui/screen/BagScreen.cpp | 8 +++++++- Makefile | 2 +- core | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/3ds/source/gui/screen/BagScreen.cpp b/3ds/source/gui/screen/BagScreen.cpp index 192cf431..283a6293 100644 --- a/3ds/source/gui/screen/BagScreen.cpp +++ b/3ds/source/gui/screen/BagScreen.cpp @@ -618,7 +618,13 @@ void BagScreen::updateFirstEmpty() std::span BagScreen::itemsForPouch(pksm::Sav::Pouch pouch) const { const auto found = std::find_if(allowedItems.begin(), allowedItems.end(), - [s = limits[0].first](const auto& i) { return i.first == s; }); + [s = pouch](const auto& i) { return i.first == s; }); + + if (found->second.size() > 1000 || found->second.size() == 0) { + // Should a match fail to be found, we don't want the app freaking out, so return an empty array. + std::array catchArr = {}; + return std::span{catchArr}; + } return found->second; } diff --git a/Makefile b/Makefile index 4c0e861d..8f788580 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ export PKSM_AUTHOR := FlagBrew export VERSION_MAJOR := 10 export VERSION_MINOR := 1 -export VERSION_MICRO := 0 +export VERSION_MICRO := 1 GIT_REV := $(shell git rev-parse --short HEAD) OLD_INFO := $(shell if [ -e appinfo.hash ]; then cat appinfo.hash; fi) NOW_INFO := $(PKSM_TITLE) $(PKSM_DESCRIPTION) $(PKSM_AUTHOR) $(VERSION_MAJOR) $(VERSION_MINOR) $(VERSION_MICRO) $(GIT_REV) diff --git a/core b/core index 78ac9c9a..fb749f09 160000 --- a/core +++ b/core @@ -1 +1 @@ -Subproject commit 78ac9c9a438bfdef8f6abecd4d925d29f20fd4bb +Subproject commit fb749f09585d30d4e7e181a935cf2acdadb2eb59