From 780c028eb3ce5aeae1c3c83e5f9e8dc958227972 Mon Sep 17 00:00:00 2001 From: Gouvernathor <44340603+Gouvernathor@users.noreply.github.com> Date: Tue, 14 Nov 2023 23:24:15 +0100 Subject: [PATCH] Use python hide instead of a single-use function (cherry picked from commit a606fc9ca264cff17755859c8323c00e1eee12b8) --- game/scripts/shops/item/chitchats.rpy | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/game/scripts/shops/item/chitchats.rpy b/game/scripts/shops/item/chitchats.rpy index c16251c9..e893c4b1 100644 --- a/game/scripts/shops/item/chitchats.rpy +++ b/game/scripts/shops/item/chitchats.rpy @@ -90,13 +90,8 @@ label purchase_item(item): $ game.gold -= item.price $ item.owned += 1 - $ item_store_achievements() - - return - -init python: - def item_store_achievements(): - # We require a function because lambdas aren't pickleable + python hide: + # We hide the lambdas which aren't pickleable if isinstance(item, Decoration): _posters = filter(lambda x: (x.type == "decoration" and x.placement == poster_OBJ), inventory.items) _hats = filter(lambda x: (x.type == "decoration" and "hat" in x.name.lower()), inventory.items) @@ -105,4 +100,6 @@ init python: achievements.unlock("postman") if all(i.owned > 0 for i in _hats): - achievements.unlock("hats") \ No newline at end of file + achievements.unlock("hats") + + return