From c3c0969be824d0bb0c4845259b18c4f76b58c9ac Mon Sep 17 00:00:00 2001 From: Gouvernathor <44340603+Gouvernathor@users.noreply.github.com> Date: Fri, 17 Nov 2023 04:05:49 +0100 Subject: [PATCH] Sort inplace and skip unused variable (cherry picked from commit e84d5cbdf01f37cb8dd04920c06223fd52307f26) --- game/scripts/interface/brewing.rpy | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/game/scripts/interface/brewing.rpy b/game/scripts/interface/brewing.rpy index 10366130..d18a40a6 100644 --- a/game/scripts/interface/brewing.rpy +++ b/game/scripts/interface/brewing.rpy @@ -9,7 +9,7 @@ init python: item = sorted(item, key=lambda x: natsort_key(x.name)) if sortby == "z-A": - item = sorted(item, key=lambda x: natsort_key(x.name), reverse=True) + item.sort(key=lambda x: natsort_key(x.name), reverse=True) return item @@ -25,7 +25,6 @@ label brewing_menu(xx=150, yy=90): current_sorting = "A-z" menu_items = brewing_sortfilter(inventory.get_instances_of_type("potion"), current_sorting, current_filter) - menu_items_length = len(menu_items) current_item = next(iter(menu_items), None) show screen brewing(xx, yy) @@ -42,7 +41,6 @@ label brewing_menu(xx=150, yy=90): $ current_filter = "Unlocked" $ menu_items = brewing_sortfilter(inventory.get_instances_of_type("potion"), current_sorting, current_filter) - $ menu_items_length = len(menu_items) $ current_item = next(iter(menu_items), None) elif __choice == "sort": if current_sorting == "A-z": @@ -51,7 +49,6 @@ label brewing_menu(xx=150, yy=90): $ current_sorting = "A-z" $ menu_items = brewing_sortfilter(inventory.get_instances_of_type("potion"), current_sorting, current_filter) - $ menu_items_length = len(menu_items) #$ current_item = next(iter(menu_items), None) elif __choice[0] == "make": if __choice[1].has_ingredients():