From 2e17dd258223bdecbacbc415eb307fcc54ac2401 Mon Sep 17 00:00:00 2001 From: Gouvernathor <44340603+Gouvernathor@users.noreply.github.com> Date: Wed, 15 Nov 2023 03:13:55 +0100 Subject: [PATCH] Avoid using reset_variables --- game/scripts/rooms/quidditch_stands/init.rpy | 9 +++++---- game/scripts/rooms/quidditch_stands2/init.rpy | 9 +++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/game/scripts/rooms/quidditch_stands/init.rpy b/game/scripts/rooms/quidditch_stands/init.rpy index e1120157..0699dc83 100644 --- a/game/scripts/rooms/quidditch_stands/init.rpy +++ b/game/scripts/rooms/quidditch_stands/init.rpy @@ -1,7 +1,6 @@ - # Quidditch stands -default quidditch_stands = { +define __quidditch_stands = { "weather": "sun_high", "rain": False, "puddles": False, @@ -11,6 +10,7 @@ default quidditch_stands = { "hole": False, "tree_fire": False } +default quidditch_stands = __quidditch_stands.copy() # Crowd density presets define crowd_few = ("low_1") @@ -55,8 +55,9 @@ label quidditch_stands(hidden=False, reset=False, **kwargs): # Update and show the area. # Pass `hidden=True` to update only, `reset=True` to reset the area before applying arguments. if reset: - $ reset_variables("quidditch_stands") - $ quidditch_stands.update(kwargs) + $ quidditch_stands = __quidditch_stands | kwargs + else: + $ quidditch_stands.update(kwargs) if not hidden: show screen quidditch_stands_back(**quidditch_stands) show screen quidditch_stands_mid(**quidditch_stands) diff --git a/game/scripts/rooms/quidditch_stands2/init.rpy b/game/scripts/rooms/quidditch_stands2/init.rpy index 8f310226..f5497edd 100644 --- a/game/scripts/rooms/quidditch_stands2/init.rpy +++ b/game/scripts/rooms/quidditch_stands2/init.rpy @@ -1,16 +1,17 @@ - # Quidditch stands -default quidditch_stands2 = { +define __quidditch_stands2 = { "weather": "sun_high", "crowd": (), "crowd_react": (None, None, None), } +default quidditch_stands2 = __quidditch_stands2.copy() label quidditch_stands2(hidden=False, reset=False, **kwargs): if reset: - $ reset_variables("quidditch_stands2") - $ quidditch_stands2.update(kwargs) + $ quidditch_stands2 = __quidditch_stands2 | kwargs + else: + $ quidditch_stands2.update(kwargs) if not hidden: show screen quidditch_stands_back2(**quidditch_stands2) show screen quidditch_stands_front2(**quidditch_stands2)