From 30687923d7d0b4a45b3b34e7793373a04082bfde Mon Sep 17 00:00:00 2001 From: LoafyLemon Date: Wed, 10 May 2023 16:16:42 +0100 Subject: [PATCH] Bug fixes * Fixed mods enabled persistent set chicken and the egg problem (init) * Fixed gift items referencing old variable --- .gitignore | 1 + game/scripts/interface/inventory.rpy | 2 +- game/scripts/mods.rpy | 5 +++-- game/scripts/wardrobe/functions.rpy | 5 +++++ 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 4fb913fb..54cc4a25 100644 --- a/.gitignore +++ b/.gitignore @@ -36,6 +36,7 @@ pip-log.txt *.rpymc project.json .android.json +buildinfo.py # Ren'py data game/saves/ diff --git a/game/scripts/interface/inventory.rpy b/game/scripts/interface/inventory.rpy index ffc61947..6ba4a385 100644 --- a/game/scripts/interface/inventory.rpy +++ b/game/scripts/interface/inventory.rpy @@ -128,7 +128,7 @@ label inventory_menu(xx=150, yy=90): elif _choice == "give": if current_item.type == "gift": - if getattr(renpy.store, "gave_{}_gift".format(states.active_girl)): + if get_character_gifted(states.active_girl): show screen blktone with d3 gen "I already gave her a gift today. Don't want to spoil her too much..." ("base", xpos="far_left", ypos="head") diff --git a/game/scripts/mods.rpy b/game/scripts/mods.rpy index ed724974..108d2058 100644 --- a/game/scripts/mods.rpy +++ b/game/scripts/mods.rpy @@ -1,10 +1,11 @@ -default persistent.mods_enabled = set() - init -999: python: import json import os + if not getattr(persistent, "mods_enabled"): + persistent.mods_enabled = set() + mods_list = dict() def mods_import(): diff --git a/game/scripts/wardrobe/functions.rpy b/game/scripts/wardrobe/functions.rpy index 7251deaf..206f52ae 100644 --- a/game/scripts/wardrobe/functions.rpy +++ b/game/scripts/wardrobe/functions.rpy @@ -82,6 +82,11 @@ init -1 python: raise KeyError("'{}' character is undefined.".format(key)) return getattr(states, f"{key[:3]}").unlocked + def get_character_gifted(key): + if not key in states.dolls: + raise KeyError("'{}' character is undefined.".format(key)) + return getattr(states, f"{key[:3]}").gifted + def get_character_mood(key): if not key in states.dolls: raise KeyError("'{}' character is undefined.".format(key))