From 1bef86f316a2c2b6955521b504a542c34e29c688 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 87f6560..f2c8a0b 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():