From 9b96c5572c9326d103c4d99936b5df2abfc08566 Mon Sep 17 00:00:00 2001 From: Gouvernathor <44340603+Gouvernathor@users.noreply.github.com> Date: Wed, 15 Nov 2023 03:16:00 +0100 Subject: [PATCH] Remove now-unused reset_variables relying on implem details It is used in a txt draft which I didn't change, it can be done if deemed necessary I think this function should be kept off, as it is both more dangerous and slower than the workarounds --- game/scripts/utility/common_functions.rpy | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/game/scripts/utility/common_functions.rpy b/game/scripts/utility/common_functions.rpy index 20eefb75..06df01d6 100644 --- a/game/scripts/utility/common_functions.rpy +++ b/game/scripts/utility/common_functions.rpy @@ -101,20 +101,6 @@ init python early: print("Error evaluating data:") print(e) - def reset_variables(*args): - """Resets the given variables to their default values.""" - # Refer to renpy.ast.Default.set_default for implementation details - defaults_set = renpy.store._defaults_set - changed_set = renpy.store.__dict__.ever_been_changed - for arg in args: - if arg in defaults_set: - if arg in changed_set: - defaults_set.remove(arg) - changed_set.remove(arg) - elif config.developer: - raise Exception("The variable `{}` was not previously set with a default value.".format(arg)) - renpy.execute_default_statement(False) - def disable_game_menu(): setattr(renpy.store, "_game_menu_screen", None) @@ -224,4 +210,4 @@ init python early: return len(self._callable()) def execute_callbacks(callbacks): - for callback in callbacks: callback() \ No newline at end of file + for callback in callbacks: callback()