fix save files being initialized incorrectly due to variable shadowing

This commit is contained in:
betalars 2025-03-23 14:56:09 +01:00
parent 47ad59c2ff
commit 1bef86f316
1 changed files with 4 additions and 3 deletions

View File

@ -16,11 +16,12 @@ func _validate_property(property: Dictionary):
property.usage = not PROPERTY_USAGE_STORAGE 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] filepath = "%s/%s" % [State.user_saves_path, unique_save_name]
else:
filepath = initial_filepath
read_save_file() read_save_file()
func read_save_file(): func read_save_file():