diff --git a/src/data/items.h b/src/data/items.h index 1a39f409b5..69806c26da 100644 --- a/src/data/items.h +++ b/src/data/items.h @@ -146,7 +146,7 @@ const struct Item gItemsInfo[] = .price = 0, .description = sQuestionMarksDesc, .pocket = POCKET_ITEMS, - .sortType = ITEM_TYPE_FIELD_USE, + .sortType = ITEM_TYPE_UNCATEGORIZED, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .iconPic = gItemIcon_QuestionMark, diff --git a/src/item_menu.c b/src/item_menu.c index 2ac5e27da9..5ec54f07c4 100755 --- a/src/item_menu.c +++ b/src/item_menu.c @@ -2954,13 +2954,18 @@ static s32 CompareItemsByMost(enum Pocket pocketId, struct ItemSlot item1, struc static s32 CompareItemsByType(enum Pocket pocketId, struct ItemSlot item1, struct ItemSlot item2) { + if (item1.itemId == ITEM_NONE) + return 1; + else if (item2.itemId == ITEM_NONE) + return -1; + enum ItemSortType type1 = gItemsInfo[item1.itemId].sortType; enum ItemSortType type2 = gItemsInfo[item2.itemId].sortType; - // Null and uncategorized items go last - if (type1 && !type2) + // Uncategorized items go last. + if (type1 != ITEM_TYPE_UNCATEGORIZED && type2 == ITEM_TYPE_UNCATEGORIZED) return -1; - else if (type2 && !type1) + else if (type2 != ITEM_TYPE_UNCATEGORIZED && type1 == ITEM_TYPE_UNCATEGORIZED) return 1; else if (type1 < type2) return -1;