Read corrupted save and settings files without engine error logs

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Denis Defolie
2026-10-17 21:04:51 +02:00
parent 97351c40a6
commit d734d603c5
3 changed files with 9 additions and 3 deletions
+3 -1
View File
@@ -70,7 +70,9 @@ func load_from_disk() -> void:
if FileAccess.file_exists(SETTINGS_PATH):
var file := FileAccess.open(SETTINGS_PATH, FileAccess.READ)
if file != null:
raw = JSON.parse_string(file.get_as_text())
var json := JSON.new()
if json.parse(file.get_as_text()) == OK:
raw = json.data
var clean := AppSettings.sanitize(raw)
volume = clean["volume"]
music_volume = clean["music_volume"]