From 5ef4d4f2db0ad7d6194f668da707748b6e1d05d9 Mon Sep 17 00:00:00 2001 From: Gouvernathor <44340603+Gouvernathor@users.noreply.github.com> Date: Tue, 14 Nov 2023 23:35:10 +0100 Subject: [PATCH] Avoid extraneous bool call (cherry picked from commit 6a4b56a182d7e46ecb2ad0bcbaa7828357589cce) --- game/scripts/shops/item/menu.rpy | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/game/scripts/shops/item/menu.rpy b/game/scripts/shops/item/menu.rpy index 707091f2..8e8b2fe6 100644 --- a/game/scripts/shops/item/menu.rpy +++ b/game/scripts/shops/item/menu.rpy @@ -31,9 +31,9 @@ label shop_item_menu(xx=150, yy=90): current_sorting = "Price (Asc)" if current_category in {"Gifts", "Ingredients"}: - category_items = [x for x in inventory_dict[current_category] if bool(x.price > 0 and x.unlocked)] + category_items = [x for x in inventory_dict[current_category] if (x.price > 0 and x.unlocked)] elif current_category in {"Books", "Scrolls", "Decorations", "Quest Items"}: - category_items = [x for x in inventory_dict[current_category] if bool(x.price > 0 and x.owned < x.limit and x.unlocked)] + category_items = [x for x in inventory_dict[current_category] if (x.price > 0 and x.owned < x.limit and x.unlocked)] menu_items = shop_item_sortfilter(category_items, current_sorting) menu_items_length = len(menu_items) @@ -50,9 +50,9 @@ label shop_item_menu(xx=150, yy=90): elif __choice[0] == "category": $ current_category = __choice[1] if current_category in {"Gifts", "Ingredients"}: - $ category_items = [x for x in inventory_dict[current_category] if bool(x.price > 0 and x.unlocked)] + $ category_items = [x for x in inventory_dict[current_category] if (x.price > 0 and x.unlocked)] elif current_category in {"Books", "Scrolls", "Decorations", "Quest Items"}: - $ category_items = [x for x in inventory_dict[current_category] if bool(x.price > 0 and x.owned < x.limit and x.unlocked)] + $ category_items = [x for x in inventory_dict[current_category] if (x.price > 0 and x.owned < x.limit and x.unlocked)] $ menu_items = shop_item_sortfilter(category_items, current_sorting) $ menu_items_length = len(menu_items) $ current_page = 0 @@ -73,9 +73,9 @@ label shop_item_menu(xx=150, yy=90): $ renpy.call("purchase_item", current_item) if current_category in {"Gifts", "Ingredients"}: - $ category_items = [x for x in inventory_dict[current_category] if bool(x.price > 0 and x.unlocked)] + $ category_items = [x for x in inventory_dict[current_category] if (x.price > 0 and x.unlocked)] elif current_category in {"Books", "Scrolls", "Decorations", "Quest Items"}: - $ category_items = [x for x in inventory_dict[current_category] if bool(x.price > 0 and x.owned < x.limit and x.unlocked)] + $ category_items = [x for x in inventory_dict[current_category] if (x.price > 0 and x.owned < x.limit and x.unlocked)] $ menu_items = shop_item_sortfilter(category_items, current_sorting) $ menu_items_length = len(menu_items)