From a0ef7ebd77bfaa05d8347b791c99f037098ca931 Mon Sep 17 00:00:00 2001 From: betalars Date: Sun, 23 Mar 2025 14:56:09 +0100 Subject: [PATCH] fix save files being initialized incorrectly due to variable shadowing --- src/dev-util/savegame.gd | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/dev-util/savegame.gd b/src/dev-util/savegame.gd index 87f6560c..f2c8a0b6 100644 --- a/src/dev-util/savegame.gd +++ b/src/dev-util/savegame.gd @@ -16,11 +16,12 @@ func _validate_property(property: Dictionary): property.usage = not PROPERTY_USAGE_STORAGE -func _init(filepath = "") -> void: +func _init(initial_filepath = "") -> void: - if filepath == "": + if initial_filepath == "": filepath = "%s/%s" % [State.user_saves_path, unique_save_name] - + else: + filepath = initial_filepath read_save_file() func read_save_file():